A GitHub Action that automates version incrementing for Continuous Integration (CI) workflows.
- Initialize Version: Go to Settings > Secrets and variables > Actions > Variables and create a repository variable
CURRENT_VERSIONwith value0.1.0. - Choose Auth:
- Simple: Use
github-token: ${{ secrets.GITHUB_TOKEN }}in your workflow. - Secure: Follow the Setup Guide (GitHub App) for multi-repo support.
- Simple: Use
- Add to Workflow:
- uses: candango/increment-version@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }} # Or use App ID/Key- Automated Version Increment: Automatically increments the patch version (X.Y.Z+1).
- GitHub App Authentication: Uses GitHub App tokens for secure API access.
- Repository Variables: Reads and updates version stored in GitHub Repository Variables.
- Tagging: Automatically creates and pushes a git tag for the new version.
This action is written in TypeScript and uses esbuild for bundling.
- Authentication: Authenticates as a GitHub App installation to gain necessary permissions.
- Retrieve Current Version: Fetches a specific repository variable (default:
CURRENT_VERSION) from the GitHub API. - Increment Logic: Parses the version string and increments the patch version.
- Update Variable: Writes the new version back to the repository variable.
- Git Tag: Tags the current commit with the new version and pushes it to the remote repository.
| Input | Description | Required | Default |
|---|---|---|---|
app-id |
GitHub App ID used to generate the token | Yes | - |
private-key |
GitHub App private key | Yes | - |
current-version-variable |
Name of the repository variable containing the version | No | CURRENT_VERSION |
| Output | Description |
|---|---|
owner |
Repository owner |
repo |
Repository name |
new-version |
The newly generated version |
When interacting with this repository, agents should:
- Follow the established ADRs in
docs/adr/for architectural decisions. - Maintain the CHANGELOG.md following the "Keep a Changelog" standard.
- Use
npm run buildto update thedist/folder after any changes toindex.ts.
MIT