Skip to content

ci: upload gh-aw binary from build job as artifact with download instructions#21440

Merged
pelikhan merged 4 commits intomainfrom
copilot/update-ci-yml-upload-gh-aw-binary
Mar 17, 2026
Merged

ci: upload gh-aw binary from build job as artifact with download instructions#21440
pelikhan merged 4 commits intomainfrom
copilot/update-ci-yml-upload-gh-aw-binary

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

The build job in ci.yml uploads the compiled gh-aw binary as a GitHub Actions artifact and writes download instructions to the job step summary.

Changes

After make build, the binary is uploaded via:

- name: Upload Linux binary
  uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
  with:
    name: gh-aw-linux-amd64
    path: gh-aw
    retention-days: 14

A subsequent step writes download instructions to $GITHUB_STEP_SUMMARY showing how to retrieve the artifact using either the GitHub CLI or curl:

GitHub CLI:

gh run download <run-id> --repo <repo> --name gh-aw-linux-amd64
chmod +x gh-aw

curl:

ARTIFACT_ID=$(curl -fsSL -H "Authorization: ******" \
  "https://api.github.com/repos/<repo>/actions/runs/<run-id>/artifacts" \
  | jq -r '.artifacts[] | select(.name=="gh-aw-linux-amd64") | .id')
curl -fsSL -H "Authorization: ******" \
  -L "https://api.github.com/repos/<repo>/actions/artifacts/$ARTIFACT_ID/zip" \
  -o gh-aw-linux-amd64.zip
unzip gh-aw-linux-amd64.zip && chmod +x gh-aw

The run ID and repository are automatically interpolated from github.run_id and github.repository.

Original prompt

Update ci.yml to upload the gh-aw binary built in build job to an artifact.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update ci.yml to upload gh-aw binary to artifact ci: upload gh-aw binary from build job as artifact Mar 17, 2026
Copilot AI requested a review from pelikhan March 17, 2026 19:57
@pelikhan
Copy link
Contributor

@copilot add a step that writes to the step summary how to use the command line to download the binary using gh cli or curl / bash.

… curl

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 17, 2026

@copilot add a step that writes to the step summary how to use the command line to download the binary using gh cli or curl / bash.

Added a "Report binary download instructions" step (cab85d9) that writes to the job summary after the upload with both options:

GitHub CLI:

gh run download <run-id> --repo <repo> --name gh-aw-linux-amd64
chmod +x gh-aw

curl:

ARTIFACT_ID=$(curl -fsSL -H "Authorization: ******" \
  "https://api.github.com/repos/<repo>/actions/runs/<run-id>/artifacts" \
  | jq -r '.artifacts[] | select(.name=="gh-aw-linux-amd64") | .id')
curl -fsSL -H "Authorization: ******" \
  -L "https://api.github.com/repos/<repo>/actions/artifacts/$ARTIFACT_ID/zip" \
  -o gh-aw-linux-amd64.zip
unzip gh-aw-linux-amd64.zip && chmod +x gh-aw

The run ID and repo are interpolated automatically from github.run_id and github.repository.

Copilot AI changed the title ci: upload gh-aw binary from build job as artifact ci: upload gh-aw binary from build job as artifact with download instructions Mar 17, 2026
@pelikhan pelikhan marked this pull request as ready for review March 17, 2026 20:53
Copilot AI review requested due to automatic review settings March 17, 2026 20:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates CI to make the gh-aw build output easier to consume by uploading the compiled binary as an artifact and documenting retrieval steps directly in the workflow run summary.

Changes:

  • Upload the Linux gh-aw binary from the build job as a GitHub Actions artifact.
  • Add a step that writes artifact download instructions (GitHub CLI + curl) to $GITHUB_STEP_SUMMARY.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +576 to +583
echo "# Requires a GitHub token with actions:read scope" >> $GITHUB_STEP_SUMMARY
echo "ARTIFACT_ID=\$(curl -fsSL -H \"Authorization: Bearer \$GH_TOKEN\" \\" >> $GITHUB_STEP_SUMMARY
echo " \"https://api.github.com/repos/${REPO}/actions/runs/${RUN_ID}/artifacts\" \\" >> $GITHUB_STEP_SUMMARY
echo " | jq -r '.artifacts[] | select(.name==\"gh-aw-linux-amd64\") | .id')" >> $GITHUB_STEP_SUMMARY
echo "curl -fsSL -H \"Authorization: Bearer \$GH_TOKEN\" \\" >> $GITHUB_STEP_SUMMARY
echo " -L \"https://api.github.com/repos/${REPO}/actions/artifacts/\$ARTIFACT_ID/zip\" \\" >> $GITHUB_STEP_SUMMARY
echo " -o gh-aw-linux-amd64.zip" >> $GITHUB_STEP_SUMMARY
echo "unzip gh-aw-linux-amd64.zip && chmod +x gh-aw" >> $GITHUB_STEP_SUMMARY
@pelikhan pelikhan merged commit 5f84729 into main Mar 17, 2026
55 checks passed
@pelikhan pelikhan deleted the copilot/update-ci-yml-upload-gh-aw-binary branch March 17, 2026 21:02
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.

3 participants