Skip to content

Save workflow logs from recent commits for SWE Agent access#104

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/save-workflow-logs
Draft

Save workflow logs from recent commits for SWE Agent access#104
Copilot wants to merge 2 commits intomainfrom
copilot/save-workflow-logs

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

Enables GitHub Copilot coding agent to access workflow logs from the two most recent commits in a PR for debugging failed builds and tests.

Changes

  • .github/scripts/download-workflow-logs.sh: Shell script queries GitHub Actions API via gh CLI to download workflow run logs from the two most recent commits, saving them to workflow-logs/ with naming pattern {commit-hash}_{run-id}_{workflow-name}.log

  • .github/workflows/copilot-setup-steps.yml:

    • Added actions: read permission for workflow API access
    • Added log download step at workflow end with continue-on-error: true
    • Passes GH_TOKEN for authentication
  • .gitignore: Excludes workflow-logs/ from version control

Mechanism

When running in a PR context:

  1. git log -n 2 retrieves latest two commit hashes
  2. gh run list --commit <hash> finds all workflow runs per commit
  3. gh run view <run-id> --log downloads each workflow's complete log
  4. Logs saved to $GITHUB_WORKSPACE/workflow-logs/ for SWE Agent access

Script gracefully handles missing runs, incomplete logs, and non-PR contexts.


Thank you for taking the time to submit a pull request!

To maximize the chances of acceptance:

  • The title of your PR should briefly describe the change.
  • Commit/merge messages to be included in NEWS.md should begin with -.
  • Code should follow the tidyverse style guide.
  • Documentation should use roxygen2, with Markdown syntax.
  • Contributions should include unit tests (using testthat).

For more information see Contributing.

Original prompt

This section details on the original issue you should resolve

<issue_title>save workflow logs</issue_title>
<issue_description>in copilot-setup-steps, download the workflow logs from the two most recent commits in the PR branch, if any, and save them somewhere that the SWE Agent can access them.</issue_description>

Comments on the Issue (you are @copilot in this section)


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

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Copilot AI changed the title [WIP] Save workflow logs from recent commits Save workflow logs from recent commits for SWE Agent access Feb 2, 2026
Copilot AI requested a review from d-morrison February 2, 2026 18:23
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.

save workflow logs

2 participants