Repository navigation
Commit 028430c
ci: migrate npm publish to OIDC trusted publishing (#983)
The npmpublish.yml workflow was authenticating via a stored NPM_TOKEN
secret that recently started failing E404 on PUT — first observed after
#981 merged at 6.1.1 (run 26279691349). Same E404 pattern that hit
ep_hljs four days ago.
Stored publish tokens have two failure modes that this PR removes
entirely:
1. They expire / get rotated and silently break automated publishes.
2. They survive in compromised CI logs / forks long enough to be
abused.
OIDC trusted publishing exchanges a short-lived GitHub-issued id-token
for a per-publish credential at the registry. No secret on our side,
no expiry, and the resulting publish is attested with `--provenance`
so the npm package page shows the signing GHA run.
Removes:
- "Set publishing config" step that consumed secrets.NPM_TOKEN
- "Add package to etherpad organization" step (the access grant is
idempotent and was set at initial publish; it doesn't need to run
on every release and the OIDC credential isn't authorised for it)
Adds:
- `permissions: { contents: write, id-token: write }` on the publish
job (contents:write was already implicit via GITHUB_TOKEN for the
version-bump push; id-token:write is the OIDC enabler)
- `registry-url` on setup-node so the auth header lands at npmjs.org
- `--no-git-checks` on pnpm publish (skip the dirty-tree guard that
would otherwise trip on the just-pushed version-bump commit)
- `--provenance` for the signing attestation
One-time setup required on https://www.npmjs.com/package/ueberdb2/access
before this lands — Trusted Publishers → Add → Provider: GitHub Actions,
Org: ether, Repo: ueberDB, Workflow: npmpublish.yml, Environment: blank.
Documented at the top of the publish-npm job.
Bumps the publish-job pnpm pin from 10 to 11 to match the test job;
trusted publishing requires pnpm >= 10.4 either way.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 11ac0b8 commit 028430c
1 file changed
Lines changed: 25 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
| |||
64 | 76 | | |
65 | 77 | | |
66 | 78 | | |
| 79 | + | |
67 | 80 | | |
68 | 81 | | |
69 | 82 | | |
70 | 83 | | |
71 | | - | |
| 84 | + | |
72 | 85 | | |
73 | 86 | | |
74 | 87 | | |
| |||
89 | 102 | | |
90 | 103 | | |
91 | 104 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
| |||
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
110 | | - | |
111 | | - | |
| 118 | + | |
| 119 | + | |
112 | 120 | | |
113 | | - | |
| 121 | + | |
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
117 | | - | |
| 125 | + | |
118 | 126 | | |
119 | 127 | | |
120 | 128 | | |
121 | 129 | | |
122 | 130 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
0 commit comments