Skip to content

Commit 26b0f61

Browse files
committed
feat(ci): add GH action to auto bump documentation version on release
1 parent 7cacc02 commit 26b0f61

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "Bump Docs Version"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
bump-version:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
ref: main
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Extract version from release tag
23+
id: extract_version
24+
run: |
25+
VERSION="${{ github.event.release.tag_name }}"
26+
echo "version=$VERSION" >> $GITHUB_OUTPUT
27+
echo "Extracted version: $VERSION"
28+
29+
- uses: pnpm/action-setup@v4
30+
with:
31+
version: 9
32+
33+
- name: Setup Node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 22
37+
cache: pnpm
38+
cache-dependency-path: "./docs/pnpm-lock.yaml"
39+
40+
- name: Update package.json version
41+
run: |
42+
cd docs
43+
pnpm version ${{ steps.extract_version.outputs.version }} --no-git-tag-version
44+
echo "Updated docs/package.json to version ${{ steps.extract_version.outputs.version }}"
45+
46+
- name: Commit updated package.json
47+
uses: stefanzweifel/git-auto-commit-action@v6
48+
with:
49+
branch: main
50+
commit_message: "chore(docs): bump version to ${{ steps.extract_version.outputs.version }}"
51+
file_pattern: "docs/package.json"

0 commit comments

Comments
 (0)