Skip to content

fix(check-upstream): fix startup_failure and idempotent open-pr - #4

Merged
vivus-ignis merged 2 commits into
mainfrom
fix-cert-manager-20261106
Nov 6, 2026
Merged

vivus-ignis merged 2 commits into
mainfrom
fix-cert-manager-20261106

Conversation

@vivus-ignis

Copy link
Copy Markdown
Collaborator

Root cause

Two issues caused the Check upstream cert-manager release workflow to fail:

1. startup_failure (runs from 2026-11-04 onwards)

Commit 4ceea54 ("feat: add SBOM generation with syft", 2026-11-03) added a release job to build-cert-manager-fips.yml that 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. The build job in check-upstream.yml only passed permissions: packages: write, so contents: write was absent → startup_failure before any job executed.

Exact error: no jobs ran at all; conclusion: startup_failure.

2. open-pr failure on re-runs

Once the startup_failure was fixed and the workflow ran end-to-end, the open-pr job failed because release/v1.21.3 already existed remotely from a prior partial run. git push was rejected with "fetch first", and gh pr create would also fail on a duplicate PR.

Fix

Commit 1 — contents: write permission (774a49f)

Added contents: write to the build job's permissions block in check-upstream.yml:

  build:
    ...
    permissions:
      packages: write
      contents: write   # required by the 'release' job in build-cert-manager-fips.yml

Commit 2 — idempotent open-pr (579979c)

Updated the Create release PR step to:

  • Detect an existing remote branch via git ls-remote and check it out instead of trying to create a duplicate.
  • Use git push --force-with-lease so the bot can safely update its own branch.
  • Guard gh pr create with gh pr view so it is skipped when a PR is already open.

Test evidence

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.
@vivus-ignis
vivus-ignis merged commit 71744e3 into main Nov 6, 2026
8 checks passed
@vivus-ignis
vivus-ignis deleted the fix-cert-manager-20261106 branch November 6, 2026 16: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.

1 participant