Skip to content

Commit 3259aff

Browse files
author
jiachengzhen
committed
ci(openclaw-plugin): allow-same-version + skip empty release commit
Fixes npm 'Version not changed' when package.json already matches inputs.version. Skip git commit when bump step leaves package.json unchanged.
1 parent f0f9030 commit 3259aff

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/openclaw-plugin-publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ jobs:
100100
MEMOS_ARMS_ENV: ${{ secrets.MEMOS_ARMS_ENV }}
101101

102102
- name: Bump version
103-
run: npm version ${{ inputs.version }} --no-git-tag-version
103+
# Branch may already have this version in package.json (e.g. after a prior merge); npm errors without this flag.
104+
run: npm version ${{ inputs.version }} --no-git-tag-version --allow-same-version
104105

105106
- name: Publish to npm
106107
run: npm publish --access public --tag ${{ inputs.tag }}
@@ -113,6 +114,8 @@ jobs:
113114
git config user.name "github-actions[bot]"
114115
git config user.email "github-actions[bot]@users.noreply.github.com"
115116
git add apps/memos-local-openclaw/package.json
116-
git commit -m "release: openclaw-plugin v${{ inputs.version }}"
117+
if ! git diff --staged --quiet; then
118+
git commit -m "release: openclaw-plugin v${{ inputs.version }}"
119+
fi
117120
git tag "openclaw-plugin-v${{ inputs.version }}"
118121
git push origin HEAD --tags

0 commit comments

Comments
 (0)