Skip to content

Commit c8dcdd0

Browse files
committed
🚑 Fix publish service
Signed-off-by: Daniel <845765@qq.com>
1 parent 12f5e36 commit c8dcdd0

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/dockerimage.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ jobs:
3535
run: |
3636
echo "value=$(jq .version ${{ env.package_json }} -r)" >> $GITHUB_OUTPUT
3737
38+
- name: Verify tag matches package.json version
39+
# 去掉 tag 前导 v 后与 package.json 中的版本号比对,
40+
# 不一致说明开发者推 tag 前忘记同步版本号,直接终止整个流程。
41+
run: |
42+
TAG="${GITHUB_REF_NAME#v}"
43+
VERSION="${{ steps.version.outputs.value }}"
44+
if [ "$TAG" != "$VERSION" ]; then
45+
echo "Tag (v$TAG) does not match version in package.json ($VERSION), stopping"
46+
exit 1
47+
fi
48+
echo "Tag matches version: $TAG"
49+
3850
- name: Free Disk Space (Ubuntu)
3951
uses: jlumbroso/free-disk-space@main
4052
with:

0 commit comments

Comments
 (0)