Skip to content

Add GitHub Actions workflow to post PR build artifact links#2638

Merged
sensei-hacker merged 1 commit into
iNavFlight:maintenance-9.xfrom
sensei-hacker:feature/configurator-pr-build-comment
May 25, 2026
Merged

Add GitHub Actions workflow to post PR build artifact links#2638
sensei-hacker merged 1 commit into
iNavFlight:maintenance-9.xfrom
sensei-hacker:feature/configurator-pr-build-comment

Conversation

@sensei-hacker
Copy link
Copy Markdown
Member

Summary

  • Adds a save-pr-number job to ci.yml that saves the PR number as an artifact on pull_request events (skipped on workflow_call release builds)
  • Adds pr-test-builds.yml that triggers via workflow_run after "Build Configurator" succeeds, then posts or updates a PR comment with a link to the build artifacts

Why workflow_run instead of pull_request

Using pull_request from a fork runs with restricted permissions — the job cannot write PR comments. The workflow_run trigger runs in the context of the base repo with full GITHUB_TOKEN permissions, so it works for fork PRs without any PAT token.

Changes

  • .github/workflows/ci.yml — new save-pr-number job 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 URL

Comment 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_run trigger 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's pr-test-builds.yml which is already proven in production.

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.
@qodo-code-review
Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@sonarqubecloud
Copy link
Copy Markdown

@sensei-hacker sensei-hacker merged commit 79c48b5 into iNavFlight:maintenance-9.x May 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant