Skip to content

ci: check the upstream base ref instead of pushing it - #13

Merged
gmaclennan merged 1 commit into
recipefrom
ci/upstream-base-check
Sep 3, 2026
Merged

ci: check the upstream base ref instead of pushing it#13
gmaclennan merged 1 commit into
recipefrom
ci/upstream-base-check

Conversation

@gmaclennan

Copy link
Copy Markdown
Member

The upstream-base job force-pushed the pinned upstream commit to
refs/heads/upstream-base using GITHUB_TOKEN. That commit carries
upstream's own .github/workflows/ files, and GitHub refuses workflow-file
writes from an App token unless it holds the workflows permission — a scope
no permissions: block can grant. The job has been failing since the base
moved to v24.20.0, with refusing to allow a GitHub App to create or update workflow .github/workflows/build-tarball.yml without workflows permission.

Automating the push means storing a PAT or deploy key with write access to
this repo, for a push taken once per upstream bump. Not worth the exposure,
so the job becomes read-only: it keeps the two ls-remotes and no-ops when
they match, and on a mismatch prints the resolved SHA and the fetch + push a
maintainer runs by hand, then fails. Permissions drop to contents: read and
the token env is gone.

It now also runs on pull_request — that guard existed only because the job
wanted contents: write, and a bump PR is where you want to learn the base
still needs pushing, rather than at release time. A bump PR will show this
check red until the ref is pushed, which can happen any time from the moment
the PR opens; nothing reads the branch except a release run.

refs/heads/upstream-base has already been pushed to v24.20.0 by hand, so the
check passes as of this PR. Docs in RELEASING.md and UPGRADING.md described
the job as moving the branch and are updated.

The upstream-base job force-pushed the pinned upstream commit to
refs/heads/upstream-base with GITHUB_TOKEN. That commit carries upstream's
own .github/workflows/ files, and GitHub refuses workflow-file writes from
an App token without the workflows permission, which no permissions: block
can grant. The push has been failing since the base moved to v24.20.0.

Automating it needs a PAT or deploy key with write access to this repo,
stored as a secret, for a push taken once per upstream bump. Not worth the
exposure. Make the job read-only: compare the two ls-remotes and, on a
mismatch, print the commands a maintainer runs by hand.

It now runs on pull_request too, so a bump PR surfaces the requirement
before merge rather than at release time.
@gmaclennan
gmaclennan merged commit de44804 into recipe Sep 3, 2026
34 checks passed
@gmaclennan
gmaclennan deleted the ci/upstream-base-check branch September 3, 2026 20:49
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.

1 participant