Skip to content

Commit 6dd3dbe

Browse files
committed
fix(semantic-release-preview): restore contents:write so verifyAuth can probe push access
1 parent 781532e commit 6dd3dbe

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎.github/workflows/semantic-release-preview.yaml‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,21 @@ on:
1919
value: ${{ jobs.preview.outputs.new_release_version }}
2020

2121
# Dry-run only: computes the next version and publishes nothing
22-
# (dry_run: true, persist-credentials: false). Read-only is sufficient.
22+
# (dry_run: true, persist-credentials: false).
23+
#
24+
# contents:write is REQUIRED and must not be reduced to read. semantic-release
25+
# core calls verifyAuth() unconditionally (index.js, no dryRun guard), which runs
26+
# `git push --dry-run --no-verify <url> HEAD:<branch>`. --dry-run is client-side
27+
# only: the remote still authorises the ref update, so a read-only token gets
28+
# 403 and the job dies with EGITNOPERMISSION before any plugin runs. That check
29+
# is the point of a preview — it proves the real release would be allowed to push.
30+
# Reducing this to `contents: read` (v2.2.7-v2.3.1, finding F5) broke every
31+
# consumer that bumped past v2.2.6.
32+
#
33+
# issues/pull-requests write are NOT needed: they are only used by the
34+
# success/fail steps, which dry-run skips.
2335
permissions:
24-
contents: read
36+
contents: write
2537

2638
jobs:
2739
preview:

0 commit comments

Comments
 (0)