Skip to content

Commit fe06d5f

Browse files
committed
feat(workflow): add copilot-setup-steps.yml for Coding Agent environment
Create copilot-setup-steps.yml workflow to pre-install tools for GitHub Copilot Coding Agent, bridging the devcontainer environment to GitHub Actions runners. Workflow includes: - SHA-pinned actions (checkout, setup-node, setup-python) - Node.js 20 with npm ci for JavaScript dependencies - Python 3.11 - PowerShell modules (PowerShell-Yaml) Update copilot-instructions.md with Coding Agent Environment section documenting pre-installed tools and npm script usage.
1 parent 4bb857d commit fe06d5f

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

.github/copilot-instructions.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,31 @@ All tracking files use markdown format with frontmatter and follow patterns from
9393

9494
PowerShell scripts follow PSScriptAnalyzer rules from `PSScriptAnalyzer.psd1` and include proper comment-based help. Validation runs via `npm run psscriptanalyzer` with results output to `logs/`.
9595
<!-- </script-operations> -->
96+
97+
<!-- <coding-agent-environment> -->
98+
## Coding Agent Environment
99+
100+
Copilot Coding Agent uses a cloud-based GitHub Actions environment, separate from the local devcontainer. The `.github/workflows/copilot-setup-steps.yml` workflow pre-installs tools to match devcontainer capabilities.
101+
102+
### Pre-installed Tools
103+
104+
* Node.js 20 with npm dependencies from `package.json`
105+
* Python 3.11
106+
* PowerShell 7 with Pester 5.7.1 and PowerShell-Yaml modules
107+
* shellcheck for bash script validation (pre-installed on ubuntu-latest)
108+
109+
### Using npm Scripts
110+
111+
Agents should use npm scripts for all validation:
112+
113+
* `npm run lint:md` - Markdown linting
114+
* `npm run lint:ps` - PowerShell analysis
115+
* `npm run lint:yaml` - YAML validation
116+
* `npm run lint:frontmatter` - Frontmatter validation
117+
* `npm run lint:all` - Run all linters
118+
* `npm run test:ps` - PowerShell tests
119+
120+
### Environment Synchronization
121+
122+
The `copilot-setup-steps.yml` mirrors tools from `.devcontainer/scripts/on-create.sh` and `.devcontainer/scripts/post-create.sh`. When adding tools to the devcontainer, update the setup workflow to maintain parity.
123+
<!-- </coding-agent-environment> -->
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# SPDX-License-Identifier: MIT
3+
#
4+
# copilot-setup-steps.yml
5+
# Pre-install tools and dependencies for GitHub Copilot Coding Agent
6+
# Reference: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment
7+
8+
name: "Copilot Setup Steps"
9+
10+
# Auto-run on push/PR to validate the setup workflow
11+
on:
12+
workflow_dispatch:
13+
push:
14+
paths:
15+
- .github/workflows/copilot-setup-steps.yml
16+
pull_request:
17+
paths:
18+
- .github/workflows/copilot-setup-steps.yml
19+
20+
jobs:
21+
# Job MUST be named 'copilot-setup-steps' to be recognized by Copilot
22+
copilot-setup-steps:
23+
runs-on: ubuntu-latest
24+
25+
# Minimal permissions; Copilot receives its own token for operations
26+
permissions:
27+
contents: read
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
32+
with:
33+
persist-credentials: false
34+
35+
- name: Set up Node.js
36+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.1.0
37+
with:
38+
node-version: "20"
39+
cache: "npm"
40+
41+
- name: Install JavaScript dependencies
42+
run: npm ci
43+
44+
- name: Set up Python
45+
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
46+
with:
47+
python-version: "3.11"
48+
49+
- name: Install PowerShell modules
50+
shell: pwsh
51+
run: |
52+
Install-Module -Name PowerShell-Yaml -Force -Scope CurrentUser
53+
54+
- name: Verify tool availability
55+
run: |
56+
echo "=== Tool Versions ==="
57+
node --version
58+
npm --version
59+
python3 --version
60+
pwsh --version
61+
shellcheck --version
62+
echo ""
63+
echo "=== npm Scripts Available ==="
64+
npm run --list

0 commit comments

Comments
 (0)