You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Bump Action Workflow
v1.0.11
Bump allows you to..well...bump an npm package version using a commit message, and push the package.json update back to the repository.
Click the Use this Template
and provide the new repo details for your action
- github_token (required) - github access token.
- user (optional) - user name (default: the user of the current push).
- email (optional) - user email. (default: current user email).
- branch (optional) - branch to work against. (default:
master
).
- version - the version being tagged and pushed.
If your head (latest) commit has the keywords #patch
, #minor
or #major
- this action will use that to perform the bump.
Defaults to patch
.
You can consume the action by referencing the v1 branch
bump:
runs-on: ubuntu-latest
steps:
- uses: tool3/bump@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
user: 'First Last'
email: 'user.email@gmail.com'
- this action requires
@actions/checkout
to be defined in a previous step. e.g:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: tool3/bump@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
user: 'First Last'
email: 'user.email@gmail.com'
- this action pushes the package.json version update back to the repo (defaults to master).
See the actions tab for runs of this action! 🚀
This is a full example workflow of patching using Bump Action and publishing to github registry and npm.
name: release
on:
push:
branches:
- release
jobs:
version_tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: tool3/bump@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish-npm:
needs: version_tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
scope: '@username'
- run: npm ci
- run: git pull origin master --tags
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-gpr:
needs: version_tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
scope: '@username'
- run: npm ci
- run: git pull origin master --tags
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}