-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathaction.yml
More file actions
43 lines (43 loc) · 1.79 KB
/
Copy pathaction.yml
File metadata and controls
43 lines (43 loc) · 1.79 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
name: "Setup Copilot"
description: "Setup Copilot CLI for testing the Java SDK."
outputs:
cli-path:
description: "Path to the Copilot CLI executable"
value: ${{ steps.cli-path.outputs.path }}
cli-version:
description: "Pinned @github/copilot version installed (read from pom.xml)"
value: ${{ steps.cli-version.outputs.version }}
runs:
using: "composite"
steps:
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v6
with:
node-version: 22
- name: Read pinned @github/copilot version from pom.xml
id: cli-version
shell: bash
# The version is the SINGLE SOURCE OF TRUTH for the Copilot CLI version
# used across all CI paths. It is kept in sync with the reference
# implementation pinned in .lastmerge by
# .github/scripts/reference-impl-sync/sync-cli-version-from-reference-impl.sh.
run: |
PROP="readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-reference-impl-sync"
VERSION=$(sed -n "s|.*<${PROP}>\(.*\)</${PROP}>.*|\1|p" pom.xml | head -n 1 | tr -d '[:space:]')
if [[ -z "$VERSION" || "$VERSION" == "PRIMER_TO_REPLACE" ]]; then
echo "::error::Could not read pinned @github/copilot version from pom.xml property <${PROP}>" >&2
exit 1
fi
echo "Pinned @github/copilot version: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Install Copilot CLI (pinned to pom.xml version)
shell: bash
env:
CLI_VERSION: ${{ steps.cli-version.outputs.version }}
run: npm install -g "@github/copilot@${CLI_VERSION}"
- name: Set CLI path
id: cli-path
run: echo "path=$(which copilot)" >> $GITHUB_OUTPUT
shell: bash
- name: Verify CLI works
run: copilot --version
shell: bash