Skip to content

Commit b458953

Browse files
autofixes from Etherpad checkPlugin.js
1 parent fb90679 commit b458953

3 files changed

Lines changed: 67 additions & 45 deletions

File tree

.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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ep_disable_reset_authorship_colours",
33
"description": "Disable The reset authorship colours button",
4-
"version": "0.0.40",
4+
"version": "0.0.41",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/ether/ep_disable_reset_authorship_colours.git"
@@ -19,7 +19,7 @@
1919
"devDependencies": {
2020
"eslint": "^8.57.1",
2121
"eslint-config-etherpad": "^4.0.4",
22-
"typescript": "^6.0.2"
22+
"typescript": "^5.9.3"
2323
},
2424
"scripts": {
2525
"lint": "eslint .",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)