Merge pull request #238 from githubnext/copilot/update-to-latest-main… #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Copilot Setup Steps" | |
| # This workflow configures the environment for GitHub Copilot Agent with gh-aw MCP server | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - .github/workflows/copilot-setup-steps.yml | |
| jobs: | |
| # The job MUST be called 'copilot-setup-steps' to be recognized by GitHub Copilot Agent | |
| copilot-setup-steps: | |
| runs-on: ubuntu-latest | |
| # Set minimal permissions for setup steps | |
| # Copilot Agent receives its own token with appropriate permissions | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| # Install gh-aw built from main (pinned to c439037c57f5af1ada2f1d8c49e0d06d192ec698) | |
| # so the Copilot Agent's gh-aw matches the version used to compile the workflow | |
| # lock files in this repo. The latest gh-aw release (v0.71.1) is missing the | |
| # create_pull_request fixes from https://github.com/github/gh-aw/pull/28472 and | |
| # https://github.com/github/gh-aw/pull/28960, which are needed to unblock autoloop. | |
| # The setup-cli action only installs tagged releases, so we build from source | |
| # pinned to a SHA on main instead. | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25' | |
| - name: Build and install gh-aw from main (pinned commit) | |
| env: | |
| GH_AW_REF: c439037c57f5af1ada2f1d8c49e0d06d192ec698 | |
| run: | | |
| set -euo pipefail | |
| mkdir -p "${RUNNER_TEMP}/gh-aw-src" | |
| cd "${RUNNER_TEMP}/gh-aw-src" | |
| git init -q | |
| git remote add origin https://github.com/github/gh-aw.git | |
| git fetch --depth 1 origin "${GH_AW_REF}" | |
| git checkout -q FETCH_HEAD | |
| mkdir -p "${HOME}/.local/share/gh/extensions/gh-aw" | |
| CGO_ENABLED=0 go build \ | |
| -ldflags "-s -w -X main.version=v0.71.1+${GH_AW_REF::7}" \ | |
| -o "${HOME}/.local/share/gh/extensions/gh-aw/gh-aw" \ | |
| ./cmd/gh-aw | |
| gh aw version |