Debian Codegraph @

.github/workflows/version-update.yml

raw
1 # This workflow bumps the package.json version and creates a PR
2
3 name: Update package version
4
5 on:
6 workflow_dispatch:
7 inputs:
8 segment:
9 description: 'Semver segment to update'
10 required: true
11 default: 'patch'
12 type: choice
13 options:
14 - minor
15 - patch
16
17 jobs:
18 update-version:
19 name: Update package version
20 runs-on: ubuntu-latest
21 steps:
22 - uses: actions/checkout@v4
23 - uses: actions/setup-node@v5
24 with:
25 node-version: 20
26 cache: 'npm'
27 - run: echo "Updating ${{ inputs.segment }} version"
28 - name: Update version
29 run: npm --no-git-tag-version version ${{ inputs.segment }}
30 - uses: peter-evans/create-pull-request@v4
31 with:
32 base: 'main'
33 branch: 'version/automated'
34 title: 'Update package version (automated)'
35 commit-message: 'Update package version'
36 body: 'Automated update to ${{ inputs.segment }} version'
37 token: ${{ secrets.DISPATCH_TOKEN }}