-
Notifications
You must be signed in to change notification settings - Fork 205
Add copilot-setup-steps.yml for workspace setup #2524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ConsoleProject ID: Tip You can use Avatars API to generate QR code for any text or URLs. |
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Comment |
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
stnguyen90
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot As mentioned in https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment, the change should happen in .github/workflows/copilot-setup-steps.yml. A copilot-setup-steps.yml file looks like a normal GitHub Actions workflow file, but must contain a single copilot-setup-steps job.
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Done! Created |
|
@copilot This new action file should set up the workspace by installing dependencies rather than messing with firewalls. |
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Updated! The file now includes workspace setup steps: checkout, Node.js setup, pnpm installation, and dependency installation, along with the harden-runner configuration for firewall settings. (21e6822) |
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
| @@ -0,0 +1,17 @@ | |||
| name: Copilot Setup Steps | |||
|
|
|||
| on: [] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is dormant, no trigger here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like the agent just uses this as a reference so might be good, we can add a manual trigger to test if needed: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot add the following so we can test this
# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the workflow triggers for manual testing and automatic validation. (f92a590)
| copilot-setup-steps: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest is v5
| - uses: actions/checkout@v4 | |
| - uses: actions/checkout@v5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to actions/checkout@v5. (f92a590)
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest is v6
| uses: actions/setup-node@v3 | |
| uses: actions/setup-node@v6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to actions/setup-node@v6. (f92a590)
| on: [] | ||
|
|
||
| jobs: | ||
| copilot-setup-steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to add permissions here if needed. Docs state:
If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the
contents: readpermission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
permissions:
contents: read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added permissions: contents: read to the job. (f92a590)
| @@ -0,0 +1,17 @@ | |||
| name: Copilot Setup Steps | |||
|
|
|||
| on: [] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot add the following so we can test this
# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
| on: [] | ||
|
|
||
| jobs: | ||
| copilot-setup-steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| copilot-setup-steps: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… action versions Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>

Creates
.github/workflows/copilot-setup-steps.ymlto set up the Copilot agent workspace with dependency installation.This required by #2522 because, otherwise, dependencies wouldn't be installed in agentic copilot sessions due to firewalls.
Changes
.github/workflows/copilot-setup-steps.ymlwith a singlecopilot-setup-stepsjobworkflow_dispatchfor manual testing through the Actions tabpushandpull_requestwith path filters to automatically validate when the file changespermissions: contents: readfor repository checkoutactions/checkout@v5actions/setup-node@v6pnpm/action-setup@v4pnpm install --frozen-lockfileThis configuration follows the GitHub Copilot documentation for customizing the agent environment and will be automatically applied to Copilot-managed workflows. The workspace setup ensures dependencies from
pkg.pr.newandpkg.vcare properly installed.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.