Skip to content

Repository files navigation

bump

Release

Reusable GitHub Action for version bump automation after merged pull requests.

It is intended for repositories that already keep their versioning logic in repo-local files and scripts, while wanting the PR orchestration, tagging, and release flow to live in one reusable action.

What it does

  • determines bump type from PR labels with patch as the fallback
  • skips bumping when the merged PR is itself a version bump PR
  • runs a repository-local version bump script
  • opens a version bump PR on a version-bump-X.Y.Z branch
  • creates the release tag when the version bump PR is merged
  • creates a GitHub release and dispatches a release workflow

Expected repository shape

This action assumes the target repository provides:

  • a version bump script, default ./scripts/version.sh
  • a version file, default VERSION
  • a pubspec file to stage in the bump PR, default pubspec.yaml
  • a whats-new JSON file to stage in the bump PR, default assets/whats_new.json
  • a release workflow that accepts inputs.tag, default release.yml

These paths are configurable through inputs.

Example

name: Version Bumpon:
pull_request:
types: [closed]branches: [main]permissions:
contents: writepull-requests: writeactions: writejobs:
bump-version:
if: github.event.pull_request.merged == trueruns-on: ubuntu-lateststeps:
- uses: actions/checkout@v4with:
fetch-depth: 0fetch-tags: truetoken: ${{ secrets.GITHUB_TOKEN }}
- uses: libnudget/bump@mainwith:
token: ${{ secrets.GITHUB_TOKEN }}pr-number: ${{ github.event.pull_request.number }}tag-prefix: desktop/app

Inputs

NameRequiredDefaultNotes
tokenyesGitHub token with repo write access
pr-numberyesMerged PR number
tag-prefixnodesktop/appRelease tag prefix
base-branchnomainDefault branch
version-scriptno./scripts/version.shRepo-local version bump script
version-filenoVERSIONRepo-local version file
pubspec-filenopubspec.yamlFile staged in version bump PR
whats-new-filenoassets/whats_new.jsonFile staged in version bump PR
release-workflownorelease.ymlWorkflow filename or ID for dispatch
git-user-namenogithub-actions[bot]Commit author name
git-user-emailnobot noreply emailCommit author email

Notes

  • The target repository remains responsible for its own version-file semantics.
  • This action is meant to orchestrate the flow, not replace repository-specific version math.
  • The bump label precedence is major > minor > patch, with patch as the default.

License

MIT

About

Automates version bumps.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages