Skip to content

ci: grant release-please job contents and pull-requests write permissions - #43

Merged
tanderson-ld merged 1 commit into
mainfrom
ta/fix-release-please-permissions
Sep 29, 2026
Merged

tanderson-ld merged 1 commit into
mainfrom
ta/fix-release-please-permissions

Conversation

@tanderson-ld

@tanderson-ld tanderson-ld commented Sep 29, 2026 •

Copy link
Copy Markdown

What

Adds an explicit permissions: block (contents: write, pull-requests: write) to the release-please job in .github/workflows/release-please.yml.

Why

release-please has failed on every push to main since 2026-09-23 (the runs for #38, #40, #42), all with the same error:

POST /repos/launchdarkly/js-eventsource/git/refs
→ 403 "Resource not accessible by integration"   (x-accepted-github-permissions: contents=write)
✖ Error when creating branch
release-please failed: Error creating Pull Request: Resource not accessible by integration

The release-please job passes token: ${{secrets.GITHUB_TOKEN}} but had no permissions: block, so it inherited the repository's default GITHUB_TOKEN permissions. It worked for every release through 2.2.0 (Apr 2025) because that default was read-write; it broke once the default was tightened to read-only, which removed the write access the job needs to create the release branch/PR. The workflow file itself has not changed since 2024-04-26 — only the environment did.

(The lone "success" on 2026-09-23 was a chore: push, which release-please treats as non-release-worthy, so it never reached the branch-creation step. The next release-worthy commits — #38, #40, #42 — all hit the 403.)

Fix

Grant the two write scopes explicitly on the job that needs them, so the workflow no longer depends on the repo default. This brings the job to parity with the js-core monorepo's release-please job, which already sets contents: write + pull-requests: write explicitly and continues to run successfully under the same GITHUB_TOKEN.

Effect

Once merged, the push to main re-runs release-please with the corrected permissions and it will open the pending release PR (covering the currently-unreleased #38, #40, #42), which on merge publishes the next version.

Notes / possible follow-ups (intentionally not in this PR)

  • If the org has also disabled "Allow GitHub Actions to create and approve pull requests," a later run could 403 on the PR-create step (a separate setting from token scope). That setting was clearly enabled through the 2.2.0 release, so it is likely still fine.
  • The action reference here (google-github-actions/release-please-action@v4) is the old org name on a floating tag; js-core uses the renamed googleapis/release-please-action pinned to a SHA. Modernizing it is optional and left out to keep this fix focused.

Note

Overview
Fixes release-please 403 failures by giving the release-please job explicit GITHUB_TOKEN scopes instead of relying on the repo default (which was tightened to read-only).

The job now declares contents: write and pull-requests: write so it can create the release branch/tag and open or update the release PR. The downstream release-package job already had these permissions; only release-please was missing them, which caused Resource not accessible by integration on recent pushes to main.

Reviewed by Cursor Bugbot for commit 97f01e5. Bugbot is set up for automated code reviews on this repo. Configure here.

@tanderson-ld
tanderson-ld requested a review from a team as a code owner September 29, 2026 17:38
@tanderson-ld
tanderson-ld merged commit 8267b40 into main Sep 29, 2026
5 checks passed
@tanderson-ld
tanderson-ld deleted the ta/fix-release-please-permissions branch September 29, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants