-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (46 loc) · 1.94 KB
/
copilot-setup-steps.yml
File metadata and controls
50 lines (46 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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