Skip to content

bump2version-action

Actions
Increment the version in one or several files using bump2version, commit, tag, and push the change
v1.0.4
Latest
Star (13)

bump2version-action

GitHub Action to increment the project's version using bump2version, commit, tag, and push the change. This operation can be fine-tuned in .bumpversion.cfg, see bumpversion --help for the details.

How to use

You need to obtain a Personal Access Token to push to your repository and save it in your Secrets as BOT_TOKEN. Suppose that your GitHub account is @your-bot-login "Your Company Bot" <[email protected]>. Suppose that your version lies in file version.md like this:

# version 1.0.0

Create a new workflow (or append to an existing one) .github/workflows/bump-version.yml:

name: Bump version workflow

on:
  push:
    branches:
    - main

jobs:
  bump-version:
    name: Bump package version
    if: "!contains(github.event.head_commit.message, 'Bump version')"
    runs-on: ubuntu-20.04
    steps:
    - name: actions/checkout
      uses: actions/checkout@v2
      with:
          persist-credentials: false
    - name: current_version
      run: echo "current_version=$(grep '# version' version.md | cut -d ' ' -f3)" >> $GITHUB_ENV
    - name: FragileTech/bump-version
      uses: FragileTech/bump-version@main
      with:
        current_version: "${{ env.current_version }}"
        files: version.md
        commit_name: Your Company Bot
        commit_email: [email protected]
        login: your-bot-login
        token: "${{ secrets.BOT_TOKEN }}"

Now every time you merge something to main branch, you'll receive an additional direct commit to main that increments the version in version.md.

License

MIT, see LICENSE.

bump2version-action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Increment the version in one or several files using bump2version, commit, tag, and push the change
v1.0.4
Latest

bump2version-action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.