Repository navigation
Re-fetch PR in require-linear so re-runs see current labels/body - #3
Merged
Ryan Zhu (underthestars-zhy) merged 1 commit intoOct 7, 2026
Merged
Conversation
"Re-run jobs" replays the original event payload, so a no-linear label or description fix added after the PR opened was invisible to the check (macrocosm-astrolabe#68). Fetch the PR with pulls.get and check that instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsMkr3BJgeq2SmvvuV6cdg
claude
Bot
requested a review
from Ryan Zhu (underthestars-zhy)
as a code owner
October 7, 2026 23:15
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
Requested by Ryan Zhu · Slack thread
Before: if you added
no-linearor fixed the description and then clicked "Re-run jobs", the check still failed. The re-run reused the event payload saved when the PR was opened, so the check never saw the change. For example, photon-hq/macrocosm-astrolabe#68 has theno-linearlabel, but its re-run (attempt 2) still failed.After: the check reads the PR's current state from the API. A re-run now sees the labels, title, description and author as they are at that moment.
How: after the existing no-payload guard, the script now calls
github.rest.pulls.get({ owner, repo, pull_number: payloadPr.number }). Every later step uses that result aspr, so nothing reads the event payload anymore.const { owner, repo } = context.repomoves up next to the guard, and the duplicate line further down is removed. The existingpull-requests: readpermission is enough. The merge_group pass still returns before the fetch.I tested this locally by pulling the script out of the YAML and running it with fake
context/core/githubobjects. The test is not committed.no-linearadded by a maintainer: passes through the label path.linear-code[bot]versus the same text from another user, and the bot allowlist.pulls.getis called exactly once with the right owner, repo and PR number.pulls.get.All 20 cases behaved as expected. actionlint v1.7.12 reports nothing, and the file parses as YAML.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NsMkr3BJgeq2SmvvuV6cdg
Generated by Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.