Skip to content

fix: prompt file needs to be read from stable branch#845

Merged
jking-aus merged 5 commits intosigp:stablefrom
shane-moore:fix/claude-mentions-prompt-file
Mar 5, 2026
Merged

fix: prompt file needs to be read from stable branch#845
jking-aus merged 5 commits intosigp:stablefrom
shane-moore:fix/claude-mentions-prompt-file

Conversation

@shane-moore
Copy link
Member

Issue Addressed

@claude mentions fail with cat: .github/prompts/review.md: No such file or directory on PRs branched before #844, which added the shared prompt file.

The workflow YAML runs from stable but reads the file from the PR's head branch, which may not have it.

Proposed Changes

Read the shared review prompt from stable instead of the checked out PR branch so it's always available regardless of when the PR was branched.

Additional Info

N/A

@shane-moore shane-moore requested a review from dknopik February 26, 2026 16:42
@claude-code-actions-sigp
Copy link

Review: 1 issue found

  • .github/workflows/claude-mentions.yml: When handling fork PRs, origin points to the fork repo (set at checkout, line 59). git fetch origin stable will fail because the fork likely has no stable branch. Should fetch from the base repo explicitly (e.g. git fetch https://github.com/$\{{ github.repository }}.git stable). The same fix in claude-pr-review.yml is fine since that workflow always checks out the base repo.

@shane-moore shane-moore force-pushed the fix/claude-mentions-prompt-file branch from be82b95 to 86b6221 Compare February 27, 2026 16:16
@shane-moore shane-moore marked this pull request as draft February 27, 2026 16:41
@shane-moore shane-moore marked this pull request as ready for review February 27, 2026 16:41
@diegomrsantos
Copy link
Member

Clarifying GitHub Actions behavior here (current semantics):

As of December 8, 2025, pull_request_target runs in default-branch context (for sigp/anchor, that is stable) regardless of PR base branch.

A useful mental model is:

  1. Workflow source/context: which ref provides workflow definition and context values like GITHUB_REF / GITHUB_SHA.
  2. Checked-out workspace: which files shell commands (cat, ls, tests) read after actions/checkout.

In this repo:

  1. claude-pr-review uses pull_request_target (.github/workflows/claude-pr-review.yml, line 7), so workflow source/context is from default branch.
  2. claude-mentions uses issue_comment + pull_request_review_comment (.github/workflows/claude-mentions.yml, line 6), and these events also run from workflow files on default branch.
  3. But in claude-mentions, we explicitly check out PR head/fork (.github/workflows/claude-mentions.yml, lines 59-60).
  4. Then cat .github/prompts/review.md (.github/workflows/claude-mentions.yml, line 84) reads from that checked-out PR workspace, not automatically from stable.

So the failure makes sense: checkout switched to a branch that didn’t contain .github/prompts/review.md yet. This PR fixes that by reading the prompt from stable explicitly.

Sources:

Copy link
Member

@diegomrsantos diegomrsantos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@jking-aus jking-aus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jking-aus jking-aus merged commit 26cfc79 into sigp:stable Mar 5, 2026
14 of 15 checks passed
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.

4 participants