Skip to content

Commit 12d9812

Browse files
committed
feat: add check-release workflow
check both public/docs/release-note.md is updated and package.json is updated Signed-off-by: Yukai Huang <[email protected]>
1 parent b9da191 commit 12d9812

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/check-release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release PR Checks
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- master
8+
9+
jobs:
10+
check-release-pr:
11+
if: startsWith(github.head_ref, 'release/')
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Check for release-notes updates
21+
run: |
22+
if ! git diff --exit-code origin/develop -- public/docs/release-notes.md; then
23+
echo "Release notes updated."
24+
else
25+
echo "Error: Release notes not updated in the PR."
26+
exit 1
27+
fi
28+
29+
- name: Compare package.json version with master
30+
run: |
31+
git fetch origin master
32+
MASTER_PACKAGE_VERSION=$(git show origin/master:package.json | jq -r '.version')
33+
BRANCH_PACKAGE_VERSION=$(jq -r '.version' package.json)
34+
35+
if [ "$BRANCH_PACKAGE_VERSION" != "$MASTER_PACKAGE_VERSION" ]; then
36+
echo "Version bumped in package.json."
37+
else
38+
echo "Error: Version in package.json has not been bumped."
39+
exit 1
40+
fi
41+

0 commit comments

Comments
 (0)