Add GitHub Actions workflow to post PR build artifact links#2638
Merged
sensei-hacker merged 1 commit intoMay 25, 2026
Conversation
Add a save-pr-number job to ci.yml that uploads the PR number as an artifact on pull_request events. This allows a downstream workflow_run job to identify which PR triggered the build. Add pr-test-builds.yml that triggers via workflow_run (not pull_request) so it has write permissions even for fork PRs. After CI succeeds, it downloads the pr-number artifact, then posts or updates a comment on the PR with a link to the GitHub Actions run where build artifacts for all platforms can be downloaded. Platforms covered: Windows x64/x32, macOS arm64/x64, Linux x64/aarch64.
Contributor
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
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
save-pr-numberjob toci.ymlthat saves the PR number as an artifact onpull_requestevents (skipped onworkflow_callrelease builds)pr-test-builds.ymlthat triggers viaworkflow_runafter "Build Configurator" succeeds, then posts or updates a PR comment with a link to the build artifactsWhy workflow_run instead of pull_request
Using
pull_requestfrom a fork runs with restricted permissions — the job cannot write PR comments. Theworkflow_runtrigger runs in the context of the base repo with fullGITHUB_TOKENpermissions, so it works for fork PRs without any PAT token.Changes
.github/workflows/ci.yml— newsave-pr-numberjob uploads PR number artifact (PR events only).github/workflows/pr-test-builds.yml— new workflow: downloads pr-number → validates → posts/updates PR comment with artifacts URLComment format
The comment uses
<!-- pr-test-build-configurator -->as a marker so subsequent pushes update the same comment rather than creating duplicates.Platforms listed: Windows x64/x32, macOS arm64/x64, Linux x64/aarch64.
A GitHub login is required to download artifacts (acceptable — testers already have GitHub accounts to post test comments).
Testing
The
workflow_runtrigger cannot be tested via draft PR alone — it activates once CI completes on a real PR. The logic is adapted directly from the firmware repo'spr-test-builds.ymlwhich is already proven in production.