Skip to content

Bump Version

Bump Version #12

Workflow file for this run

name: Bump Version
on:
workflow_dispatch:
permissions:
id-token: write
contents: write
jobs:
bum-version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Use trust-ci fine-grained PAT to checkout and later commit the code
# trust-ci is allowed to bypass the branch protection
token: ${{ secrets.CI_GITHUB_TOKEN }}
- name: Calculate version
id: tag-version
uses: mathieudutour/github-tag-action@v6.1
with:
dry_run: true
github_token: ${{ secrets.CI_GITHUB_TOKEN }}
# Configure Git
- name: Git configuration
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
- name: Bump npm version
run: npm version --commit-hooks false --git-tag-version false ${{ steps.tag-version.outputs.new_tag }}
- name: Commit updated npm package.json
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[skip ci] bump npm version to ${{ steps.tag-version.outputs.new_tag }}'
branch: main
file_pattern: 'package*.json'
commit_user_name: trust-ci
commit_user_email: "trust-ci@users.noreply.github.com"
- name: Bump version and push tag
uses: mathieudutour/github-tag-action@v6.1
with:
custom_tag: ${{ steps.tag-version.outputs.new_version }}
github_token: ${{ secrets.CI_GITHUB_TOKEN }}