A GitHub composite action that automatically bumps versions in package.json or .csproj files based on a <!-- Version: TYPE --> comment in a CHANGELOG.md [Unreleased] section.
It discovers all changelogs in the repository automatically — no configuration needed.
- Recursively finds every
CHANGELOG.mdin the repository. - Checks whether the
[Unreleased]section contains a comment like:<!-- Version: minor --> - Finds the
package.jsonor.csprojin the same directory and bumps its version accordingly. - Moves the
[Unreleased]content to a new versioned section with today's date and removes the comment.
Supported bump types: major, minor, patch.
Supported version files: package.json, any .csproj using <Version> or <ApplicationDisplayVersion>.
name: Auto Version Bump
on:
push:
branches:
- main
paths:
- '**/CHANGELOG.md'
permissions:
contents: write
jobs:
version-bump:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump versions
id: version-bump
uses: vensas/auto-version-bump-action@main
- name: Commit and push changes
if: steps.version-bump.outputs.has_changes == 'true'
run: |
git add -A
git commit -m "chore: bump versions after merge [skip ci]
${{ steps.version-bump.outputs.updates }}"
git push origin main| Input | Required | Default | Description |
|---|---|---|---|
auto-commit |
No | false |
Commit and push the version bump changes automatically. Requires permissions: contents: write. |
commit-message |
No | chore: bump versions [skip ci]\n\n{updates} |
Commit message when auto-commit is enabled. {updates} is replaced with the list of version changes. |
post-bump-command |
No | (none) | Shell command to run after bumping but before committing. Use this to regenerate lockfiles. Only runs when auto-commit is enabled and changes were made. |
git-user-name |
No | github-actions[bot] |
Git user.name for the auto-commit. |
git-user-email |
No | github-actions[bot]@users.noreply.github.com |
Git user.email for the auto-commit. |
version-files |
No | {} |
JSON map of changelog path to version file path (both repo-relative). Overrides auto-discovery for specific entries. |
| Output | Description |
|---|---|
has_changes |
true if at least one version was bumped, otherwise false |
updates |
Comma-separated list of updates, e.g. src/frontend: 1.2.0 -> 1.3.0 (minor) |
To have the action commit and push changes itself, enable auto-commit. This removes the need for a separate commit step in your workflow:
- name: Bump versions
uses: vensas/auto-version-bump-action@main
with:
auto-commit: 'true'If your project uses a lockfile that needs to be regenerated after a version bump (e.g. package-lock.json, pnpm-lock.yaml), use post-bump-command to handle that before the commit:
- name: Bump versions
uses: vensas/auto-version-bump-action@main
with:
auto-commit: 'true'
post-bump-command: 'cd src/frontend && pnpm install --lockfile-only'Note: The default commit message includes
[skip ci]to prevent the workflow from triggering itself again when the updatedCHANGELOG.mdis pushed back to the branch.
If a changelog is not in the same directory as its version file, use version-files to map them explicitly:
- name: Bump versions
uses: vensas/auto-version-bump-action@main
with:
version-files: '{"src/backend/Feps/CHANGELOG.md": "src/backend/Feps/Feps.Api/Feps.Api.csproj"}'Auto-discovery still runs for all other changelogs — only the mapped entries are overridden.
## [Unreleased]
<!-- Version: minor -->
### Added
- Some new featureAfter the action runs, this becomes:
## [Unreleased]
## [1.3.0] - 2026-05-05
### Added
- Some new featureContributions are welcome! See CONTRIBUTING.md for guidelines on how to get started.
The most impactful way to contribute is adding support for additional languages and version file formats. Currently supported:
| Language / Platform | Version file | Version tag |
|---|---|---|
| JavaScript / Node.js | package.json |
version field |
| C# (.NET) | *.csproj |
<Version> or <ApplicationDisplayVersion> |