Skip to content

Commit a07b4b9

Browse files
Add GitHub Actions workflow for Copilot agent environment setup (#163)
## Overview This PR adds a new GitHub Actions workflow file `.github/workflows/copilot-setup-steps.yml` to preconfigure the environment for GitHub Copilot agents. This workflow ensures that Copilot agents have the necessary dependencies and tools installed before they begin their operations. ## Changes - Created `.github/workflows/copilot-setup-steps.yml` with a job named `copilot-setup-steps` (required by GitHub Copilot) - Integrated setup steps from the existing `build-and-test.yml` workflow to ensure consistency: - Checkout code using `actions/checkout@v5` - Setup .NET SDK with versions 3.1.x and 8.x using `actions/setup-dotnet@v5` - Restore project dependencies with `dotnet restore` ## Workflow Configuration - **Runs on**: `ubuntu-latest` - **Permissions**: `contents: read` (minimal permissions required) - **Triggers**: - Manual dispatch via the Actions tab - Automatic execution on push/PR when the workflow file itself is modified (for easy validation) ## Benefits - GitHub Copilot agents will have a properly configured .NET environment with all dependencies restored - Reduces setup time and potential errors during agent operations - Maintains consistency with the existing CI/CD pipeline setup steps - Allows for easy testing and validation of the setup process This workflow follows GitHub's recommended pattern for Copilot agent setup and uses the same action versions as the existing `build-and-test.yml` workflow for consistency. <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > Create a GitHub Actions workflow file at .github/workflows/copilot-setup-steps.yml to preconfigure the environment for GitHub Copilot agents. The workflow should include a single job named 'copilot-setup-steps'. Integrate setup and reusable actions from the existing build and test CI workflows to ensure consistency and proper environment configuration. > > ex: > > ``` > name: "Copilot Setup Steps" > > # 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 > > jobs: > # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. > copilot-setup-steps: > runs-on: ubuntu-latest > > # Set the permissions to the lowest permissions possible needed for your steps. > # Copilot will be given its own token for its operations. > permissions: > # If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete. > contents: read > > # You can define any steps you want, and they will run before the agent starts. > # If you do not check out your code, Copilot will do this for you. > steps: > - name: Checkout code > uses: actions/checkout@v5 > etc... > ``` </details> <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/IntelliTect/Multitool/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com> Co-authored-by: Benjamin Michaelis <git@relay.benjamin.michaelis.net>
1 parent b4ae641 commit a07b4b9

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ jobs:
2323
- name: Setup .NET
2424
uses: actions/setup-dotnet@v5
2525
with:
26-
dotnet-version: |
27-
3.1.x
28-
8.x
26+
global-json-file: global.json
2927
- name: Restore dependencies
3028
run: dotnet restore
3129
- name: Build
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
16+
copilot-setup-steps:
17+
runs-on: ubuntu-latest
18+
19+
# Set the permissions to the lowest permissions possible needed for your steps.
20+
# Copilot will be given its own token for its operations.
21+
permissions:
22+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
23+
contents: read
24+
25+
# You can define any steps you want, and they will run before the agent starts.
26+
# If you do not check out your code, Copilot will do this for you.
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v5
30+
31+
- name: Setup .NET
32+
uses: actions/setup-dotnet@v5
33+
with:
34+
global-json-file: global.json
35+
36+
- name: Restore dependencies
37+
run: dotnet restore

0 commit comments

Comments
 (0)