Persist generated text for later workflow steps.

Section: GitHub Actions patterns

Write Copilot output to a file artifact

yaml
yaml
- run: copilot -p "Generate a brief test report from the logs in this directory." > report.md
Explanation

Then upload `report.md` as an artifact or attach it to a release.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing GitHub Actions patterns
Install Copilot CLI in a Linux job with Homebrew
Bootstrap Copilot in a GitHub Actions runner.
OpenIn sheetyamlsame section
Install Copilot CLI in a workflow with npm
Use Node-based installation in CI.
OpenIn sheetyamlsame section
Provide a token in GitHub Actions
Authenticate programmatically in a workflow step.
OpenIn sheetyamlsame section
Run a prompt in a workflow step
Execute Copilot in a job step.
OpenIn sheetyamlsame section
Capture output in a script
Store Copilot output in a shell variable.
OpenIn sheetbash1 tag match
Describe large files in a shell loop
Use Copilot inside a `while` loop.
OpenIn sheetbash1 tag match