Repository navigation
fix(check-upstream): fix startup_failure and idempotent open-pr - #4
Merged
Merged
Conversation
The 'release' job added in build-cert-manager-fips.yml (commit 4ceea54) declares 'permissions: contents: write'. GitHub validates at startup that every permission a called reusable workflow's jobs request is a subset of what the caller grants; 'contents: write' was absent from the 'build' job's permissions block in check-upstream.yml, causing startup_failure.
…tently If the scheduled check fires again for the same version (e.g. after a startup_failure or manual re-run), 'git push' was rejected because release/vX.Y.Z already existed remotely, and 'gh pr create' would also fail because the PR was already open. - Detect the existing remote branch and check it out instead of trying to create a new one with the same name. - Use --force-with-lease so the bot can update its own branch safely. - Guard 'gh pr create' with 'gh pr view' so it is skipped when a PR already exists for that branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
Two issues caused the
Check upstream cert-manager releaseworkflow to fail:1.
startup_failure(runs from 2026-11-04 onwards)Commit
4ceea54("feat: add SBOM generation with syft", 2026-11-03) added areleasejob tobuild-cert-manager-fips.ymlthat declarespermissions: contents: write. GitHub validates at startup that every permission a called reusable workflow's jobs request is a subset of what the caller grants. Thebuildjob incheck-upstream.ymlonly passedpermissions: packages: write, socontents: writewas absent →startup_failurebefore any job executed.Exact error: no jobs ran at all;
conclusion: startup_failure.2.
open-prfailure on re-runsOnce the
startup_failurewas fixed and the workflow ran end-to-end, theopen-prjob failed becauserelease/v1.21.3already existed remotely from a prior partial run.git pushwas rejected with "fetch first", andgh pr createwould also fail on a duplicate PR.Fix
Commit 1 —
contents: writepermission (774a49f)Added
contents: writeto thebuildjob'spermissionsblock incheck-upstream.yml:Commit 2 — idempotent open-pr (
579979c)Updated the
Create release PRstep to:git ls-remoteand check it out instead of trying to create a duplicate.git push --force-with-leaseso the bot can safely update its own branch.gh pr createwithgh pr viewso it is skipped when a PR is already open.Test evidence