Skip to content

ci(release): gate release PRs on Apple notarization readiness - #3703

Draft
setchy wants to merge 2 commits into
mainfrom
ci/apple-notarization-readiness
Draft

setchy wants to merge 2 commits into
mainfrom
ci/apple-notarization-readiness

Conversation

@setchy

@setchy setchy commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Context

The 8.2.0 release failed at macOS notarization with Apple's HTTP 403: A required agreement is missing or has expired. Packaging then failed the matrix, Publish release was skipped, and no v8.2.0 tag was created. release-please could not find the missing tag, scanned the whole history, and proposed a bogus 9.0.0 release.

This PR adds a pre-merge gate so a stale Apple agreement blocks the release PR instead of a build hours later.

What changed

  • Add Apple notarization readiness, a check that calls notarytool history with the same APPLE_ID_* credentials the release uses. It authenticates without submitting an artifact, but returns the same 403 when an agreement is missing or expired.
  • Only release-please PRs do the real check. Every other PR gets a fast no-op so the check can be required on main without blocking or slowing normal PRs.
  • Check out the base branch's verification script, never PR code, because the job has access to the Apple secrets.
  • Fail on the first 403 instead of retrying. Propagation lag is handled by re-running the check, which keeps the result unambiguous and avoids burning macOS minutes.
  • Add an Apple preflight to publish.yml so manual dispatches fail in seconds instead of after build/sign/notarize.
  • Document the gate and the workflow approval step in CONTRIBUTING.md.

Tasks

  • Merge this PR
  • On the next release-please PR, select Approve workflows to run (release-please opens the PR with GITHUB_TOKEN, so GitHub holds its workflow runs for approval before CI starts)
  • Confirm Apple notarization readiness runs and passes (the workflow only exists on main, so it cannot run on this PR)
  • Add Apple notarization readiness to the required status checks for main
  • Decide whether to enforce the gate for admins (main currently has enforce_admins: false, so admins can bypass required checks)
  • When recovering 8.2.0, dispatch publish.yml from the v8.2.0 tag ref (not main), so the built source matches the release commit

Notes

  • The check name is the job name: Apple notarization readiness.
  • No new token is introduced. Release PR workflow runs require one manual approval from a user with write access.
  • If the Apple agreement was just accepted, Apple can take a few minutes to propagate. Re-run the check after a short wait; the first 403 is expected during that window.
  • The verification script lives in scripts/verifyAppleNotarization.sh so the PR gate and the publish preflight use the same logic.

Validation

  • actionlint
  • shellcheck scripts/verifyAppleNotarization.sh
  • vp fmt --check
  • git diff --check

Add a required-check-ready workflow that calls notarytool history with the release Apple credentials. It fails when the Apple Developer Program License Agreement is missing or expired, with a message naming the Account Holder and both agreement locations.

Release PRs created with GITHUB_TOKEN start their pull_request runs in action_required, so add an optional RELEASE_PLEASE_TOKEN (falling back to GITHUB_TOKEN) to let the check and the existing CI run automatically.

Also add a publish preflight so manual dispatches fail fast, and document the new gate and token in CONTRIBUTING.
@github-actions github-actions Bot added the build Build, action or package manager changes label Nov 17, 2026
Keep the workflow approval gate instead of introducing a repo-wide write token. Document the Approve workflows to run step and fail the notarization check on the first 403; a maintainer can re-run it after Apple propagates the accepted agreement.
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build, action or package manager changes

Development

Successfully merging this pull request may close these issues.

1 participant