fix(release): gate canary releases on PR label#7717
Conversation
|
There was a problem hiding this comment.
Pull request overview
Updates the Release GitHub Actions workflow so canary publishing is opt-in via a “Canary Release” PR label, while ensuring main and candidate releases don’t run for PR label/sync events.
Changes:
- Add
pull_requesttriggers (labeled,synchronize) to support label-driven canary runs. - Gate
release-canaryon label presence and check out the PR head SHA for builds. - Prevent
release-mainandrelease-candidatefrom running onpull_requestevents.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/release.yml | Adds PR triggers and job-level if: gating so canary runs only when labeled; main/candidate skip PR events; canary checks out PR head SHA. |
| .github/pull_request_template.md | Documents how to trigger a canary release via the “Canary Release” label. |
Comments suppressed due to low confidence (1)
.github/workflows/release.yml:126
actions/checkoutis usingref: ${{ github.event.pull_request.head.sha }}but doesn’t setrepository:. For forked PRs that commit SHA usually isn’t ingithub.repository, so checkout will fail unless you also setwith.repository: ${{ github.event.pull_request.head.repo.full_name }}(or ensure the job never runs for forks).
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: ${{ github.event.pull_request.head.sha }}
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Would be good to recommend this label in https://github.com/primer/react/blob/main/.github/workflows/recommend-integration-tests.yml as well |
…nary release instructions
Updates the
release-canaryjob in the Release workflow so that canary releases are opt-in via a "Canary Release" label on a PR, rather than running on every branch push.Changes:
pull_request: types: [labeled, synchronize]trigger to the workflowrelease-canarynow only runs when:release-mainandrelease-candidateare gated withgithub.event_name != 'pull_request'so they skip PR label eventsgithub.event.pull_request.head.shafor the canary job to build the actual PR head commitChangelog
New
Changed
Removed
Rollout strategy
This is a CI workflow change only — no package code is modified.
Testing & Reviewing
mainstill triggers onlyrelease-mainchangeset-release/mainstill triggers onlyrelease-candidaterelease-canaryrelease-canaryMerge checklist