github/workflow: Fix the PR Labeling for Build System#18422
Merged
lupyuen merged 1 commit intoapache:masterfrom Feb 22, 2026
Merged
github/workflow: Fix the PR Labeling for Build System#18422lupyuen merged 1 commit intoapache:masterfrom
lupyuen merged 1 commit intoapache:masterfrom
Conversation
Our New PR Labeler incorrectly labels the Changed Files for Build System. Here is a Sample PR that contains changes for Arm32 CMake and Makefile: lupyuen6#59 ``` arch/arm/CMakeLists.txt arch/arm/Makefile ``` But our PR Labeler incorrectly labels the above as `Area: Build system, Arch: Arm`, which triggers a Complete CI Build across All Architectures (according to arch.yml). The correct label should be `Arch: Arm`, which will trigger only the Arm32 Build: #1 This PR fixes the PR Labeling. The New PR Labeler is explained here: - https://lupyuen.org/articles/prtarget - apache#18359 `.github/workflows/labeler.yml`: Changed the Regex Pattern. Now we match the Start Of Line and End Of Line. Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
1 task
1 task
linguini1
approved these changes
Feb 21, 2026
simbit18
approved these changes
Feb 21, 2026
acassis
approved these changes
Feb 21, 2026
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
Our New PR Labeler incorrectly labels the Changed Files for Build System. Here is a Sample PR that contains changes for Arm32 CMake and Makefile: lupyuen6#59
But our PR Labeler incorrectly labels the above as
Area: Build system, Arch: Arm, which triggers a Complete CI Build across All Architectures (according to arch.yml). The correct label should beArch: Arm, which will trigger only the Arm32 Build: lupyuen8#1This PR fixes the PR Labeling. The New PR Labeler is explained here:
Modified Files
.github/workflows/labeler.yml: Changed the Regex Pattern. Now we match the Start Of Line and End Of Line.Impact
Is a new or modified feature? This solution fixes the way PRs are labeled for
Area: Build systemImpact on build: Builds will work the same. Except that the PR Labeler will now label
Area: Build systemcorrectly.Impact on documentation: I wrote a Detailed Article that explains why pull_request_target is unsafe, and how we reimplemented PR Labeling safely: https://lupyuen.org/articles/prtarget
Impact on security: NO
Impact on compatibility: NO
Impact on user: NO
Impact on hardware: NO
Anything else: We documented all Design Decisions here: [BUG] GitHub Actions workflow policy violation: pull_request_target #18359
When this PR has been Merged: I shall standby 24 x 7 to watch over GitHub CI and ensure that everything works exactly the same as before. (Unless I'm out for Marathon Training: 7 hours / 42 km)
Later the same changes shall be ported to the NuttX Apps repo
Testing
We confirm that the changes are verified on our own NuttX Repo and work as intended. Here are the Test Cases:
https://gist.github.com/lupyuen/5748c468315b5ba0567464a5cca69403
Arch Labeling
Area: Build systemand trigger a Complete BuildArch: armand trigger an Arm32-only BuildSize Labeling
Response Time
PR Labeling must complete within 1.5 minutes
Why? The Build Workflow begins in the Fetch-Source stage, checking out the Entire Repo and uploading everything in 1.5 minutes, followed by the Select-Builds stage (arch.yml) reading the PR Labels. Before 1.5 minutes, rightfully our workflow_run trigger would have written the PR Labels to the PR.
PR Labeling now completes in 13 elapsed seconds, spanning 2 jobs. (Previously: 35 elapsed seconds, in 1 job)
Zizmor Security Scan
workflow_runas a Potential Security Issue, because it's unable to analyse the code inside the workflow.workflow_runis not forbidden in the ASF GitHub Actions Security Policy.Test Logs are here: https://gist.github.com/lupyuen/5748c468315b5ba0567464a5cca69403