Skip to content

Pin cherry-pick workflow checkout to main - #157

Merged
kriszyp merged 1 commit into
mainfrom
fix-cherry-pick-checkout-ref
May 18, 2026
Merged

Pin cherry-pick workflow checkout to main#157
kriszyp merged 1 commit into
mainfrom
fix-cherry-pick-checkout-ref

Conversation

@kriszyp

@kriszyp kriszyp commented May 18, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #151. The cherry-pick workflow fails on PRs that branched off main before the helper script .github/scripts/upsert-sticky-comment.js landed:

Error: Cannot find module '.../.github/scripts/upsert-sticky-comment.js'

For pull_request events, actions/checkout defaults to the PR head ref. If the PR predates the helper script on main, the working tree is missing the script and node bails out.

Fix

Pin actions/checkout to ref: main in both cherry-pick-patch.yml and report-cherry-pick-tests.yml. The workflow doesn't need the PR's working tree — it operates on git refs explicitly fetched, so checking out main is correct.

Review focus

One file each — two trivial diffs. Worth confirming we're comfortable always running the workflow logic from main; that means a PR that updates the workflow itself won't see its own changes tested via the label trigger (use workflow_dispatch from the branch for that).

🤖 Generated by Claude Opus 4.7 (1M context).

For pull_request events, actions/checkout defaults to the PR head ref.
PRs branched off main before .github/scripts/upsert-sticky-comment.js
landed will have a working tree missing that script, so node fails with
MODULE_NOT_FOUND when the workflow tries to invoke it.

Pin both cherry-pick-patch.yml and report-cherry-pick-tests.yml to
ref: main so the helper script is always present.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kriszyp
kriszyp requested review from a team as code owners May 18, 2026 19:43
@claude

claude Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Reviewed; no blockers found.

@kriszyp
kriszyp merged commit c38b0f0 into main May 18, 2026
11 checks passed
@kriszyp
kriszyp deleted the fix-cherry-pick-checkout-ref branch May 18, 2026 19:44
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