fix(ci): skip labeler for fork pull requests#281
Open
luoyanglang wants to merge 1 commit intocft0808:mainfrom
Open
fix(ci): skip labeler for fork pull requests#281luoyanglang wants to merge 1 commit intocft0808:mainfrom
luoyanglang wants to merge 1 commit intocft0808:mainfrom
Conversation
4 tasks
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.
Summary
Issue: CI false-red on fork pull requests in
Auto Label PRsType: Bug Fix
Severity: Low
This PR avoids a false-red CI failure in fork PRs by skipping the
labeljob when the pull request head repo is a fork. The existingsize-labeljob remains unchanged.Root Cause
actions/labeler@v6needs write permission to add labels to pull requests, but fork PRs triggered viapull_requestdo not get a write-capableGITHUB_TOKENin this context.Current workflow:
.github/workflows/auto-label.yml:12labelalways runs onpull_requestResource not accessible by integrationThat means fork-based contribution PRs can go red even when no functional checks are failing.
Fix Description
Changed files:
.github/workflows/auto-label.yml:12- skip thelabeljob whengithub.event.pull_request.head.repo.forkis trueWhy this approach:
size-labelunchanged, so PR sizing still works.If you would prefer to preserve auto-labeling for fork PRs as well, I’m happy to switch this to a
pull_request_target-based approach or another workflow shape you prefer.Test Results
labeljob condition changedsize-labelremains untouchedDisprove Analysis
Is this already fixed elsewhere?
main; thelabeljob still runs unconditionally onpull_request.cft0808/edict#280reproduces the problem path directly.Impact scope
labeljob as before.size-labelstill runs for both cases.Edge cases
Known limitation
actions/labelerlabels under this conservative fix.Checklist
Found while investigating the failing
labelcheck on a fork PR. Happy to adjust if you prefer a different workflow strategy.