From fe06d5f968e685d0fd0125445c57b369f4e6b6c7 Mon Sep 17 00:00:00 2001 From: katriendg Date: Tue, 3 Feb 2026 12:46:37 +0100 Subject: [PATCH 1/6] 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. --- .github/copilot-instructions.md | 28 ++++++++++ .github/workflows/copilot-setup-steps.yml | 64 +++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 .github/workflows/copilot-setup-steps.yml diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 9ff3b98b8..a7fd0d479 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -93,3 +93,31 @@ All tracking files use markdown format with frontmatter and follow patterns from 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/`. + + +## Coding Agent Environment + +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. + +### Pre-installed Tools + +* Node.js 20 with npm dependencies from `package.json` +* Python 3.11 +* PowerShell 7 with Pester 5.7.1 and PowerShell-Yaml modules +* shellcheck for bash script validation (pre-installed on ubuntu-latest) + +### Using npm Scripts + +Agents should use npm scripts for all validation: + +* `npm run lint:md` - Markdown linting +* `npm run lint:ps` - PowerShell analysis +* `npm run lint:yaml` - YAML validation +* `npm run lint:frontmatter` - Frontmatter validation +* `npm run lint:all` - Run all linters +* `npm run test:ps` - PowerShell tests + +### Environment Synchronization + +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. + diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 000000000..7952edb31 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,64 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# +# copilot-setup-steps.yml +# Pre-install tools and dependencies for GitHub Copilot Coding Agent +# Reference: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment + +name: "Copilot Setup Steps" + +# Auto-run on push/PR to validate the setup workflow +on: + workflow_dispatch: + push: + paths: + - .github/workflows/copilot-setup-steps.yml + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + +jobs: + # Job MUST be named 'copilot-setup-steps' to be recognized by Copilot + copilot-setup-steps: + runs-on: ubuntu-latest + + # Minimal permissions; Copilot receives its own token for operations + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2 + with: + persist-credentials: false + + - name: Set up Node.js + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.1.0 + with: + node-version: "20" + cache: "npm" + + - name: Install JavaScript dependencies + run: npm ci + + - name: Set up Python + uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 + with: + python-version: "3.11" + + - name: Install PowerShell modules + shell: pwsh + run: | + Install-Module -Name PowerShell-Yaml -Force -Scope CurrentUser + + - name: Verify tool availability + run: | + echo "=== Tool Versions ===" + node --version + npm --version + python3 --version + pwsh --version + shellcheck --version + echo "" + echo "=== npm Scripts Available ===" + npm run --list From a0542ca1ee69bc8fae734c2057f57dd4571a2a8d Mon Sep 17 00:00:00 2001 From: katriendg Date: Tue, 3 Feb 2026 16:18:34 +0100 Subject: [PATCH 2/6] chore(instructions): add attribution note to copilot-instructions.md --- .github/copilot-instructions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index a7fd0d479..e29376723 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -121,3 +121,5 @@ Agents should use npm scripts for all validation: 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. + + From e9371655d12508fee750a915f15bd3358953d76b Mon Sep 17 00:00:00 2001 From: katriendg Date: Tue, 3 Feb 2026 16:58:56 +0100 Subject: [PATCH 3/6] style(instructions): update attribution note in copilot-instructions.md for clarity --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index e29376723..8548dedc6 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -122,4 +122,4 @@ Agents should use npm scripts for all validation: 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. - +🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers. From a8afb15be97c5beb8d5b9385713f0e2c63eb4806 Mon Sep 17 00:00:00 2001 From: Katrien De Graeve Date: Tue, 3 Feb 2026 17:09:37 +0100 Subject: [PATCH 4/6] Update .github/copilot-instructions.md PR review comment Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 8548dedc6..e9fd39bf8 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -91,7 +91,7 @@ All tracking files use markdown format with frontmatter and follow patterns from * Scripts follow instructions provided by the codebase for convention and standards. * Scripts used by the codebase have an `npm run` script for ease of use. -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/`. +PowerShell scripts follow PSScriptAnalyzer rules from `PSScriptAnalyzer.psd1` and include proper comment-based help. Validation runs via `npm run lint:ps` with results output to `logs/`. From 110033a948811cf3832bad8750e46079e4f8abad Mon Sep 17 00:00:00 2001 From: Katrien De Graeve Date: Tue, 3 Feb 2026 17:20:01 +0100 Subject: [PATCH 5/6] chore: copilot PR suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 7952edb31..0f93fa2d2 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -33,7 +33,7 @@ jobs: persist-credentials: false - name: Set up Node.js - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.1.0 + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 with: node-version: "20" cache: "npm" From 47f31e1a629676fef32d50d928a93338a8edd9c9 Mon Sep 17 00:00:00 2001 From: Katrien De Graeve Date: Tue, 3 Feb 2026 17:20:45 +0100 Subject: [PATCH 6/6] chore: add PSScriptAnalyzer module per PR review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 0f93fa2d2..300d811ae 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -50,6 +50,7 @@ jobs: shell: pwsh run: | Install-Module -Name PowerShell-Yaml -Force -Scope CurrentUser + Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser - name: Verify tool availability run: |