microsoft/hve-core
Publicmirrored fromhttps://github.com/microsoft/hve-coreAvailable
.github/workflows/copilot-setup-steps.yml
77lines · modecode
| 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 | # Copilot coding agent runs these steps internally before starting work. |
| 11 | # Use workflow_dispatch to manually validate the setup when desired. |
| 12 | on: |
| 13 | workflow_dispatch: |
| 14 | |
| 15 | jobs: |
| 16 | # Job MUST be named 'copilot-setup-steps' to be recognized by Copilot |
| 17 | copilot-setup-steps: |
| 18 | runs-on: ubuntu-latest |
| 19 | |
| 20 | # Minimal permissions; Copilot receives its own token for operations |
| 21 | permissions: |
| 22 | contents: read |
| 23 | |
| 24 | steps: |
| 25 | - name: Checkout code |
| 26 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2 |
| 27 | with: |
| 28 | persist-credentials: false |
| 29 | |
| 30 | - name: Set up Node.js |
| 31 | uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.1.0 |
| 32 | with: |
| 33 | node-version: "20" |
| 34 | cache: "npm" |
| 35 | |
| 36 | # continue-on-error allows Copilot to start work even if dependencies fail, |
| 37 | # so it can fix package.json/package-lock.json issues itself |
| 38 | - name: Install JavaScript dependencies |
| 39 | continue-on-error: true |
| 40 | run: npm ci |
| 41 | |
| 42 | - name: Set up Python |
| 43 | uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 44 | with: |
| 45 | python-version: "3.11" |
| 46 | |
| 47 | - name: Install actionlint |
| 48 | env: |
| 49 | ACTIONLINT_VERSION: '1.7.10' |
| 50 | ACTIONLINT_SHA256: 'f4c76b71db5755a713e6055cbb0857ed07e103e028bda117817660ebadb4386f' |
| 51 | run: | |
| 52 | curl -sLO "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" |
| 53 | echo "${ACTIONLINT_SHA256} actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" | sha256sum -c - |
| 54 | tar -xzf "actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" actionlint |
| 55 | sudo install actionlint /usr/local/bin/actionlint |
| 56 | rm actionlint "actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" |
| 57 | actionlint --version |
| 58 | |
| 59 | - name: Install PowerShell modules |
| 60 | shell: pwsh |
| 61 | run: | |
| 62 | Install-Module -Name PowerShell-Yaml -Force -Scope CurrentUser |
| 63 | Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser |
| 64 | Install-Module -Name Pester -RequiredVersion 5.7.1 -Force -Scope CurrentUser |
| 65 | |
| 66 | - name: Verify tool availability |
| 67 | run: | |
| 68 | echo "=== Tool Versions ===" |
| 69 | node --version |
| 70 | npm --version |
| 71 | python3 --version |
| 72 | pwsh --version |
| 73 | shellcheck --version |
| 74 | actionlint --version |
| 75 | echo "" |
| 76 | echo "=== npm Scripts Available ===" |
| 77 | npm run --list |
| 78 | |