Files
setup-copilot/action.yml
2026-03-10 16:58:53 -04:00

44 lines
1.2 KiB
YAML

name: "Setup Copilot CLI"
description: "Install the GitHub Copilot CLI for use in GitHub Actions workflows"
branding:
icon: "terminal"
color: "blue"
inputs:
version:
description: "Version of Copilot CLI to install (e.g. '1.0.0', 'latest', 'prerelease')"
required: false
default: "latest"
github-token:
description: "GitHub token to download Copilot CLI. Defaults to the workflow token."
required: false
default: ${{ github.token }}
outputs:
version:
description: "The version of Copilot CLI that was installed"
value: ${{ steps.version.outputs.version }}
runs:
using: "composite"
steps:
- name: Install Copilot CLI
shell: bash
env:
VERSION: ${{ inputs.version }}
PREFIX: ${{ runner.tool_cache }}/copilot
run: curl -fsSL https://gh.io/copilot-install | bash
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
- name: Add to PATH
shell: bash
run: echo "${{ runner.tool_cache }}/copilot/bin" >> "$GITHUB_PATH"
- name: Verify installation
id: version
shell: bash
run: |
copilot --version
echo "version=$(copilot --version | head -1)" >> "$GITHUB_OUTPUT"