This GitHub Action automatically increments and tags the latest commit with
a Calendar Versioning (CalVer) scheme in the format Year.Month.Increment
Year is the two or four digit year (2023 or 23)
Month is the month excluding padding (1..12)
Increment is the number that's incremented per commit and resets to 0 at the start of every month
Name | Description | Required | Default | Options |
---|---|---|---|---|
GITHUB_TOKEN |
Your GitHub Token to allow the action to create tags | yes | ||
YEAR_FORMAT |
Format of the year value, eg. YYYY = 2024 YY = 24 |
no | YYYY |
YYYY YY |
INITIAL_INCREMENT |
Initial increment value | no | 0 |
Any positive integer |
Name | Description |
---|---|
NEW_TAG |
The new tag auto-incremented using the CalVer action. |
To use this GitHub Action in your workflow, you can include the following step in your workflow configuration
file (.github/workflows/calver.yml
):
name: CalVer increment and tag
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "0"
- name: Increment and tag with CalVer
uses: mani-sh-reddy/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
YEAR_FORMAT: "YY"
At the start of each workflow job, GitHub automatically creates a unique GITHUB_TOKEN
secret to use in your workflow. You can use the GITHUB_TOKEN
to authenticate in the workflow job.
You can use the GITHUB_TOKEN
by using the standard syntax for referencing secrets: ${{ secrets.GITHUB_TOKEN }}
. Examples of using the GITHUB_TOKEN
include passing the token as an input to an action, or using it to make an authenticated GitHub API request.
ref: Automatic token authentication
This GitHub Action is released under the MIT License. See the License File for more details.
If you would like to contribute to this project, please follow the Contribution Guidelines.
If you encounter any issues or have questions about this GitHub Action, please open an issue in the GitHub repository.
This action is based on the idea of Calendar Versioning (CalVer) and is inspired by other versioning and release automation actions in the GitHub Marketplace.