To use this action, you need to choose an authentication method and set up a repository variable to store the version.
Best for multi-repository automation and high security.
- Create a GitHub App:
- Go to your organization or account Settings > Developer settings > GitHub Apps.
- Click New GitHub App.
- Set a name (e.g.,
My-Versioning-Bot) and a homepage URL (any URL will do). - Permissions (Repository permissions):
- Actions:
Read and write(to manage variables). - Contents:
Read and write(to push tags and read repo data). - Variables:
Read and write(explicitly required for Repository Variables).
- Actions:
- Save the app and note the App ID.
- Generate Private Key:
- In the app settings, scroll down to Private keys and click Generate a private key.
- Download the
.pemfile and copy its entire content.
- Install the App:
- Go to Install App in the sidebar and install it on the repositories you want to automate.
- Configure Secrets:
- In your repository Settings > Secrets and variables > Actions, add:
APP_ID: Your GitHub App ID.APP_PRIVATE_KEY: The entire content of the.pemfile.
- In your repository Settings > Secrets and variables > Actions, add:
Best for quick prototyping or single-repo use.
- Get a Token (PAT - Personal Access Token):
- Go to Settings > Developer settings > Personal access tokens > Tokens (classic).
- Select the following scopes:
repo: Full control of repositories (required for tags and variables).workflow: Required for actions that modify workflow runs.
- Save and copy the generated token immediately.
- Configure Secret:
- In your repository Settings > Secrets and variables > Actions, add the token as a secret (e.g.,
MY_GITHUB_TOKEN).
- In your repository Settings > Secrets and variables > Actions, add the token as a secret (e.g.,
- Important for Organization Repositories: Ensure the PAT has access to the organization where the repository resides.
This action relies on a GitHub Repository Variable to track the current version.
- Go to your repository Settings > Secrets and variables > Actions > Variables.
- Click New repository variable.
- Name:
CURRENT_VERSION(or your custom name). - Value:
0.1.0(your starting version). Use a SemVer compatible format (e.g.,0.0.1,1.0.0) or PEP 440 for Python.
name: Release Version
on:
push:
branches: [master]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: candango/increment-version@v1
with:
# Use ONE of the following:
# A) GitHub App Auth
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
# OR B) Direct Token Auth
# github-token: ${{ secrets.MY_PAT_OR_GITHUB_TOKEN }}
# Optional: Configure language
language: 'python'
file-path: 'src/my_app/__init__.py'For advanced pre-release (alpha/beta) workflows, see the Examples Section.