Use GitHub token to download Copilot CLI

This commit is contained in:
Devraj Mehta
2026-03-10 16:58:53 -04:00
parent 4689bdf64c
commit ce338b190a
2 changed files with 5 additions and 9 deletions

View File

@@ -18,7 +18,7 @@ steps:
| Input | Description | Required | Default | | Input | Description | Required | Default |
| -------------- | ------------------------------------------------- | -------- | ---------------- | | -------------- | ------------------------------------------------- | -------- | ---------------- |
| `version` | Version to install (`latest`, `prerelease`, or a specific version like `1.0.0`) | No | `latest` | | `version` | Version to install (`latest`, `prerelease`, or a specific version like `1.0.0`) | No | `latest` |
| `github-token` | GitHub token for Copilot authentication | No | `github.token` | | `github-token` | GitHub token for downloading Copilot CLI | No | `github.token` |
## Outputs ## Outputs
@@ -47,7 +47,7 @@ steps:
```yaml ```yaml
- uses: actions/setup-copilot@v1 - uses: actions/setup-copilot@v1
with: with:
github-token: ${{ secrets.COPILOT_TOKEN }} github-token: ${{ secrets.GH_TOKEN }}
``` ```
## How it works ## How it works

View File

@@ -10,7 +10,7 @@ inputs:
required: false required: false
default: "latest" default: "latest"
github-token: github-token:
description: "GitHub token for Copilot authentication. Defaults to the workflow token." description: "GitHub token to download Copilot CLI. Defaults to the workflow token."
required: false required: false
default: ${{ github.token }} default: ${{ github.token }}
@@ -28,17 +28,13 @@ runs:
VERSION: ${{ inputs.version }} VERSION: ${{ inputs.version }}
PREFIX: ${{ runner.tool_cache }}/copilot PREFIX: ${{ runner.tool_cache }}/copilot
run: curl -fsSL https://gh.io/copilot-install | bash run: curl -fsSL https://gh.io/copilot-install | bash
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
- name: Add to PATH - name: Add to PATH
shell: bash shell: bash
run: echo "${{ runner.tool_cache }}/copilot/bin" >> "$GITHUB_PATH" run: echo "${{ runner.tool_cache }}/copilot/bin" >> "$GITHUB_PATH"
- name: Set GITHUB_TOKEN
shell: bash
env:
GH_TOKEN: ${{ inputs.github-token }}
run: echo "GITHUB_TOKEN=${GH_TOKEN}" >> "$GITHUB_ENV"
- name: Verify installation - name: Verify installation
id: version id: version
shell: bash shell: bash