{"id":49292393,"url":"https://github.com/jfrz38/auto-version-bump-action","last_synced_at":"2026-04-26T01:01:32.597Z","repository":{"id":353861027,"uuid":"1221074954","full_name":"jfrz38/auto-version-bump-action","owner":"jfrz38","description":"A reusable GitHub Action for SemVer version bumps in Gradle, npm, and custom project files.","archived":false,"fork":false,"pushed_at":"2026-04-25T23:30:10.000Z","size":264,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2026-04-26T00:31:21.936Z","etag":null,"topics":["github-actions","semver","version-bump","versioning"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jfrz38.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-25T18:08:08.000Z","updated_at":"2026-04-25T23:30:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jfrz38/auto-version-bump-action","commit_stats":null,"previous_names":["jfrz38/version-bump-action"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jfrz38/auto-version-bump-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrz38%2Fauto-version-bump-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrz38%2Fauto-version-bump-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrz38%2Fauto-version-bump-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrz38%2Fauto-version-bump-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfrz38","download_url":"https://codeload.github.com/jfrz38/auto-version-bump-action/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrz38%2Fauto-version-bump-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32282187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","semver","version-bump","versioning"],"created_at":"2026-04-26T01:01:28.323Z","updated_at":"2026-04-26T01:01:32.559Z","avatar_url":"https://github.com/jfrz38.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auto Version Bump Action\n\n[![CI](https://github.com/jfrz38/auto-version-bump-action/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jfrz38/auto-version-bump-action/actions/workflows/ci.yml)\n[![GitHub release](https://img.shields.io/github/v/release/jfrz38/auto-version-bump-action?display_name=tag)](https://github.com/jfrz38/auto-version-bump-action/releases)\n[![GitHub Marketplace](https://img.shields.io/badge/marketplace-check--version--change-blue?logo=githubactions)](https://github.com/marketplace/actions/auto-version-bump-action)\n[![License](https://img.shields.io/github/license/jfrz38/auto-version-bump-action)](LICENSE)\n\nReusable GitHub Action that bumps a simple SemVer version, commits the change to a bump branch, pushes it, and opens a draft pull request.\n\nIt is designed for release-preparation workflows where a maintainer reviews and merges the version bump before a separate release workflow creates tags, GitHub Releases, or publishes artifacts.\n\n## Quick start\n\nUse this action after `actions/checkout` and give the workflow permission to push a branch and open a pull request.\n\n```yaml\nname: Bump Version\n\non:\n  workflow_dispatch:\n    inputs:\n      bump:\n        type: choice\n        required: true\n        options: [patch, minor, major]\n\npermissions:\n  contents: write\n  pull-requests: write\n\njobs:\n  bump:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n\n      - uses: jfrz38/auto-version-bump-action@v0\n        with:\n          bump: ${{ inputs.bump }}\n          strategy: npm\n          version-file: package.json\n```\n\nThis creates or reuses a branch such as `chore/bump-version-1.2.4`, commits the version change, and opens a draft pull request.\n\n## What it does\n\n- Reads the current version from a supported project file.\n- Validates simple SemVer: `MAJOR.MINOR.PATCH`.\n- Calculates a `patch`, `minor`, or `major` bump.\n- Updates the version file.\n- Fails if the target tag or GitHub Release already exists, unless disabled.\n- Creates and pushes `chore/bump-version-{next-version}` by default.\n- Opens a GitHub pull request, draft by default.\n- Reuses an existing open PR for the same branch/base instead of creating a duplicate.\n\n## What it does not do\n\n- It does not create a git tag.\n- It does not create a GitHub Release.\n- It does not publish packages or artifacts.\n- It does not merge the pull request.\n\n## Inputs\n\n| Input | Required | Default | Description |\n| --- | --- | --- | --- |\n| `bump` | Yes | | Version component to bump: `patch`, `minor`, or `major`. |\n| `strategy` | Yes | | Version file strategy: `gradle-kts`, `npm`, or `regex`. |\n| `version-file` | Yes | | Path to the file that contains the version. |\n| `version-pattern` | For `regex` | | Regex with exactly one capture group containing the current version. |\n| `version-replacement` | For `regex` | | Replacement template. Use `{version}` for the next version. |\n| `base-branch` | No | current/default branch | Base branch for the pull request. |\n| `branch-prefix` | No | `chore/bump-version-` | Prefix for the bump branch. |\n| `tag-prefix` | No | `v` | Prefix used for tag/release existence checks. |\n| `draft` | No | `true` | Whether to create the pull request as a draft. |\n| `github-token` | No | `${{ github.token }}` | Token used for checks and PR creation. |\n| `commit-message` | No | `Bump version to {version}` | Commit message template. |\n| `pr-title` | No | `Bump version to {version}` | Pull request title template. |\n| `pr-body` | No | `Bumps version from {current-version} to {next-version} using a {bump} release bump.` | Pull request body template. |\n| `fail-if-tag-exists` | No | `true` | Fail if `${tag-prefix}${next-version}` already exists as a tag. |\n| `fail-if-release-exists` | No | `true` | Fail if a GitHub Release already exists for the tag. |\n\nTemplate inputs support:\n\n- `{version}` and `{next-version}`\n- `{current-version}`\n- `{bump}`\n\n## Outputs\n\n| Output | Description |\n| --- | --- |\n| `current-version` | Version read before applying the bump. |\n| `next-version` | Version written by the action. |\n| `tag` | Tag name associated with the next version. |\n| `branch` | Branch pushed by the action. |\n| `pr-url` | Created or reused pull request URL. |\n| `changed-files` | Newline-separated list of files changed by the bump. |\n\n## Permissions\n\nThe workflow using this action needs:\n\n```yaml\npermissions:\n  contents: write\n  pull-requests: write\n```\n\nUse `actions/checkout` with the target base branch and `fetch-depth: 0`.\n\n## npm\n\nFor `package.json`, the action reads and updates the `version` field.\n\nWithout a `package-lock.json`, it writes the next version directly to `package.json`.\n\nIf a same-directory `package-lock.json` exists, the action runs:\n\n```bash\nnpm version \u003cnext-version\u003e --no-git-tag-version --allow-same-version\n```\n\nExample:\n\n```yaml\n- uses: actions/checkout@v4\n  with:\n    ref: ${{ inputs.base_branch }}\n    fetch-depth: 0\n\n- id: bump\n  uses: jfrz38/auto-version-bump-action@v0\n  with:\n    bump: ${{ inputs.bump }}\n    base-branch: ${{ inputs.base_branch }}\n    strategy: npm\n    version-file: package.json\n```\n\n## Gradle Kotlin DSL\n\nFor `gradle-kts`, the action updates exactly one Kotlin DSL version assignment in the configured file:\n\n```kotlin\nversion = \"0.1.2\"\n```\n\nIt fails if no matching assignment exists or if the file contains multiple matching version assignments.\n\nWorkflow:\n\n```yaml\nname: Bump Version\n\non:\n  workflow_dispatch:\n    inputs:\n      bump:\n        type: choice\n        required: true\n        options: [patch, minor, major]\n      base_branch:\n        type: choice\n        required: true\n        default: develop\n        options: [develop, main]\n\npermissions:\n  contents: write\n  pull-requests: write\n\njobs:\n  bump:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          ref: ${{ inputs.base_branch }}\n          fetch-depth: 0\n\n      - id: bump\n        uses: jfrz38/auto-version-bump-action@v0\n        with:\n          bump: ${{ inputs.bump }}\n          base-branch: ${{ inputs.base_branch }}\n          strategy: gradle-kts\n          version-file: mockguard/build.gradle.kts\n```\n\n## Regex\n\nUse `regex` for files that are not covered by a built-in strategy.\n\n`version-pattern` must match the text to replace and include exactly one capture group containing the current version. `version-replacement` replaces the whole match; put `{version}` where the next version should be written.\n\nExample file:\n\n```txt\nreleaseVersion=1.2.3\n```\n\nExample workflow step:\n\n```yaml\n- id: bump\n  uses: jfrz38/auto-version-bump-action@v0\n  with:\n    bump: minor\n    strategy: regex\n    version-file: VERSION.txt\n    version-pattern: 'releaseVersion=(\\d+\\.\\d+\\.\\d+)'\n    version-replacement: 'releaseVersion={version}'\n```\n\nFor example, to update a Rust `Cargo.toml` package version:\n\n```toml\n[package]\nname = \"demo\"\nversion = \"1.2.3\"\n```\n\n```yaml\n- id: bump\n  uses: jfrz38/auto-version-bump-action@v0\n  with:\n    bump: patch\n    strategy: regex\n    version-file: Cargo.toml\n    version-pattern: '^version\\s*=\\s*\"(\\d+\\.\\d+\\.\\d+)\"'\n    version-replacement: 'version = \"{version}\"'\n```\n\n## Release flow\n\nThis action intentionally stops at the pull request. A separate workflow can create the tag and GitHub Release after the bump PR is merged into the release branch.\n\nThat keeps the release boundary explicit:\n\n1. Run this action manually.\n2. Review and merge the bump PR.\n3. Let a release workflow create `v{version}` from the merged branch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfrz38%2Fauto-version-bump-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfrz38%2Fauto-version-bump-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfrz38%2Fauto-version-bump-action/lists"}