Thank you for considering contributing to the Cloudsmith CLI Install Action! Here are the steps to create a Pull Request (PR) and the necessary variables and secrets for GitHub Actions. \
Note: This repository uses a Husky pre-commit hook to automatically build and stage the bundled action code in
dist/index.js. You should not manually edit files underdist/.
- Navigate to the Cloudsmith CLI Install Action repository.
- Click the "Fork" button at the top right of the page.
- Open your terminal and clone your forked repository:
git clone <your-forked-repo-url>
- Create a new branch for your feature or bug fix:
git checkout -b <branch-name>
- Make the necessary changes in your local repository.
- Commit your changes with a descriptive message:
git commit -m "Your commit message"
The pre-commit hook will:
- Ensure dependencies are installed (if
node_modulesis missing) - Run
npm run build(which bundles the action via@vercel/nccintodist/index.js) - Stage
dist/index.jsif it changed
If the build fails, the commit is aborted. Fix issues (lint, syntax, missing deps) and commit again.
To skip the hook (rarely needed, e.g. emergency hotfix where build already validated), you can use:
git commit -m "Your commit message" --no-verify
Please avoid skipping unless absolutely necessary—having dist/ in-sync with source ensures tagged releases run reliably.
- Push your changes to your forked repository:
git push origin <branch-name>
- Navigate to your forked repository on GitHub.
- Click the "Compare & pull request" button.
- Provide a descriptive title and detailed description of your changes.
- Click "Create pull request".
To run this project locally, you need to have Node.js and npm installed. Follow these steps:
- Install the dependencies:
npm install
- Build the project:
npm run build
You normally do not need to run npm run build manually before committing; the pre-commit hook will handle it. Running it locally first can still help surface errors earlier.
- Commit your changes to GitHub.
- Configure the variables below and trigger the test action.
To run the GitHub Actions workflows, you need to set up the following variables and secrets in your repository:
- NAMESPACE: Your Cloudsmith OIDC namespace.
- SERVICE_ACCOUNT: Your Cloudsmith OIDC service account slug.
- CLOUDSMITH_API_KEY: Your Cloudsmith API key.
To add these variables and secrets:
-
Navigate to Your Repository Settings:
- Go to your repository on GitHub.
- Click on "Settings".
-
Add Variables:
- Go to "Secrets and variables" > "Actions" > "Variables".
- Click "New repository variable" and add NAMESPACE and SERVICE_ACCOUNT.
-
Add Secrets:
- Go to "Secrets and variables" > "Actions" > "Secrets".
- Click "New repository secret" and add CLOUDSMITH_API_KEY.
Here is an example of how you might modify the test_install.yml workflow to use a different CLI version and authentication method:
- name: Install Cloudsmith CLI
uses: cloudsmith-io/cloudsmith-cli-action@v1
with:
cli-version: 1.3.0
auth-method: token
token: ${{ secrets.CLOUDSMITH_API_KEY }}You can modify other inputs similarly based on your requirements.
Thank you for contributing! If you have any questions, feel free to open an issue or reach out to the maintainers.