forked from github/copilot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
38 lines (38 loc) · 1.33 KB
/
Copy pathaction.yml
File metadata and controls
38 lines (38 loc) · 1.33 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
name: "Setup Copilot"
description: "Setup Copilot based on the project's package.json file."
outputs:
cli-path:
description: "Path to the Copilot CLI"
value: ${{ steps.cli-path.outputs.path }}
runs:
using: "composite"
steps:
- uses: actions/setup-node@v6
if: runner.os != 'Windows'
with:
cache: "npm"
cache-dependency-path: "./nodejs/package-lock.json"
node-version: 22
- uses: actions/setup-node@v6
if: runner.os == 'Windows'
with:
node-version: 22
- name: Install dependencies
run: npm --prefix "$(pwd)/nodejs" ci --ignore-scripts
shell: bash
- name: Set CLI path
id: cli-path
run: |
# As of CLI 1.0.64-1 the @github/copilot package is a thin loader; the
# runnable index.js ships in the installed platform package
# (e.g. @github/copilot-linux-x64). Exactly one is installed.
cli_path=$(ls "$(pwd)"/nodejs/node_modules/@github/copilot-*/index.js 2>/dev/null | head -n1)
if [ -z "$cli_path" ]; then
echo "Could not find @github/copilot platform package (index.js) under nodejs/node_modules" >&2
exit 1
fi
echo "path=$cli_path" >> $GITHUB_OUTPUT
shell: bash
- name: Verify CLI works
run: node ${{ steps.cli-path.outputs.path }} --version
shell: bash