fix(ci): gate extract-claude-lessons on head branch, not PR author#212
Merged
Conversation
The previous filter required the PR's user.login to contain 'claude', but Claude Code on the web pushes to a claude/* branch and a human opens the PR — so user.login is the human and the workflow has never fired. Switch to startsWith(head.ref, 'claude/'), which matches the actual signal of Claude involvement. https://claude.ai/code/session_01M9a6hQdzjmLh7rL6ak1PLk
Contributor
There was a problem hiding this comment.
Confirmed via gh api /repos/TensorAuto/OpenTau/pulls?state=closed: every recently merged PR has user.login = shuheng-liu and head.ref starting with claude/, matching the PR description's backfill table. The new gate (startsWith(github.event.pull_request.head.ref, 'claude/')) is the right signal.
A few notes:
pull_request.head.refis the bare branch name (norefs/heads/prefix), sostartsWith(..., 'claude/')is the correct comparison.- Recursion guard is unchanged (the
chore(claude): learn fromtitle check), so lessons-extraction PRs — which would also be onclaude/*branches — still won't loop. - The change is workflow-YAML only; the PR explicitly defers
pre-commitandpytest. That's appropriate here — the only way to truly validate is to merge and watch the next mergedclaude/*PR.
No blocking issues found.
Contributor
|
[claude-review] summary for commit cd6a496 No blocking issues found.
|
3 tasks
shuheng-liu
added a commit
that referenced
this pull request
May 2, 2026
) (cherry picked from commit 35629df)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
.github/workflows/extract-claude-lessons.ymlwas added in #199 butits
if:gate has never let a job run. The previous condition was:Two notes on why this was failing — both from looking at the recent
merged PRs (#171, #178, #182, #183, #189, #190, #198, #199, #204, #207,
#208, #209, #206):
[closed]is the right trigger — there is no[merged]actiontype for
pull_requestin GitHub Actions.closedfires for bothclose-without-merge and merge, and the
merged == truecheckcorrectly narrows it. So the trigger isn't the bug.
user.loginis the wrong field. In this repo, Claude Code onthe web pushes to a
claude/<slug>branch, then a human (e.g.shuheng-liu) opens the PR. Sopull_request.user.loginis thehuman, never
claude*, andcontains(..., 'claude')is alwaysfalse. The reliable signal is the head branch prefix, which is
under Claude Code's control.
This PR swaps the filter to
startsWith(head.ref, 'claude/'). Backfillacross the 14 most-recent merged PRs:
contains(user.login, 'claude')(old)startsWith(head.ref, 'claude/')(new)Tag: 🐛 Bug
How it was tested
gh api .../pulls?state=closed) thatevery recent PR's
user.loginis the human reviewer's login andevery Claude-touched PR's
head.refstarts withclaude/.if:changed).pre-commit run --all-files— the sandbox this PR wasauthored in has no
pre-commitbinary. Please run it locally if theCI hook complains.
pytestwas run.tests: skipped — workflow YAML condition only, no Python touched.How to checkout & try? (for the reviewer)
The workflow only fires on
pull_request: closed, so the real test isto merge this PR and watch the next merged
claude/*PR — theextract-lessonsjob should now appear in the Actions tab and eitheropen a
chore(claude): learn from #NPR or exit cleanly.Checklist
(This PR only touches a single GitHub Actions YAML file — no Python
functions are added or changed, so the docstring item is vacuously
satisfied. The policy-changes box is correctly unchecked.)
Note: Before submitting this PR, please read the contributor guideline.