Skip to content

Commit ee3cd05

Browse files
autofixes from Etherpad checkPlugin.js
1 parent 7ad5365 commit ee3cd05

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

.github/workflows/npmpublish.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
publish-npm:
1616
runs-on: ubuntu-latest
1717
permissions:
18-
contents: write # for `git push --follow-tags` of the version bump
18+
contents: write # for the atomic version-bump push (branch + tag)
1919
id-token: write # for npm OIDC trusted publishing
2020
steps:
2121
- uses: actions/setup-node@v6
@@ -60,8 +60,22 @@ jobs:
6060
git config user.name 'github-actions[bot]'
6161
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
6262
pnpm i
63+
# `pnpm version patch` bumps package.json, makes a commit, and creates
64+
# a `v<new-version>` tag. Capture the new tag name from package.json
65+
# rather than parsing pnpm's output, which has historically varied.
6366
pnpm version patch
64-
git push --follow-tags
67+
NEW_TAG="v$(node -p "require('./package.json').version")"
68+
# CRITICAL: use --atomic so the branch update and the tag update
69+
# succeed (or fail) as a single transaction on the server. The old
70+
# `git push --follow-tags` was non-atomic per ref: if a concurrent
71+
# publish run won the race, the branch fast-forward would be rejected
72+
# but the tag push would still land — leaving a dangling tag with no
73+
# matching commit on the branch. Subsequent runs would then forever
74+
# try to bump to the same already-existing tag and fail with
75+
# `tag 'vN+1' already exists`. With --atomic, a rejected branch push
76+
# rejects the tag push too, and the next workflow tick can retry
77+
# cleanly against the up-to-date refs.
78+
git push --atomic origin "${GITHUB_REF_NAME}" "${NEW_TAG}"
6579
# This is required if the package has a prepare script that uses something
6680
# in dependencies or devDependencies.
6781
-

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"type": "git",
1919
"url": "git+https://github.com/ether/ep_subscript_and_superscript.git"
2020
},
21-
"version": "0.3.32",
21+
"version": "0.3.33",
2222
"funding": {
2323
"type": "individual",
2424
"url": "https://etherpad.org/"

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)