Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 12, 2025

This PR implements automatic artifact link posting in pull requests, following the approach demonstrated in TibixDev/winboat#66.

Problem

When contributors create pull requests, reviewers need to manually navigate to the Actions tab to find and download build artifacts for testing. This adds friction to the review process and makes it harder to quickly test changes.

Solution

This PR enhances the CI workflow to automatically post a comment with a direct link to build artifacts on every pull request. The implementation adds:

  1. Workflow permissions - Added pull-requests: write permission to allow the workflow to post comments
  2. Artifact step ID - Added an id to the upload-artifact step to capture the artifact URL
  3. Comment posting step - Added a conditional step that posts a comment with the artifact link when running on PRs

How It Works

When a pull request is created or updated:

  1. The CI workflow builds the project using goreleaser
  2. Build artifacts are uploaded to GitHub Actions
  3. A comment is automatically posted to the PR with a direct link to the artifacts
  4. Reviewers can click the link to immediately download and test the built binaries

Example comment that will be posted:

Build artifacts: [https://github.com/gliptak/hcl2json/actions/runs/123/artifacts/456](https://github.com/gliptak/hcl2json/actions/runs/123/artifacts/456)

Benefits

  • Improved reviewer experience - Direct access to artifacts from the PR conversation
  • Faster feedback cycles - No need to navigate through the Actions UI
  • Better visibility - Build artifacts are prominently linked in the PR

Implementation Notes

  • The comment posting step only runs on pull_request events, not on pushes to master or tag releases
  • Uses the peter-evans/create-or-update-comment@v4 action which will update the existing comment if it already exists
  • The artifact-url output is a documented feature of upload-artifact@v4 action
  • Changes are minimal and surgical, only affecting the CI workflow file

Closes #[issue_number_if_applicable]

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/actions/upload-artifact/releases/latest
    • Triggering command: curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Link artifact in PR follow approach at @TibixDev/winboat/pull/66


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@gliptak gliptak marked this pull request as ready for review October 12, 2025 01:52
@github-actions
Copy link

@github-actions
Copy link

Copilot AI changed the title [WIP] Link artifact in PR following reference approach Add artifact link posting to PRs following TibixDev/winboat#66 approach Oct 12, 2025
Copilot AI requested a review from gliptak October 12, 2025 01:55
Copilot finished work on behalf of gliptak October 12, 2025 01:55
@github-actions
Copy link

@github-actions
Copy link

@gliptak gliptak merged commit 6b1086d into master Oct 12, 2025
5 checks passed
@gliptak gliptak deleted the copilot/link-artifact-in-pr branch October 12, 2025 02:05
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.

2 participants