github / github/copilot-cli

Error: No authentication information found

オープン
#3,746 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:authentication area:non-interactive
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

### Describe the bug

Hello,

I am facing the following error using GitHub Copilot CLI programatically:

```
Error: No authentication information found.
Copilot can be authenticated with GitHub using an OAuth Token or a Fine-Grained Personal Access Token.
To authenticate, you can use any of the following methods:
• Start 'copilot' and run the '/login' command
• Set the COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN environment variable
• Run 'gh auth login' to authenticate with the GitHub CLI
Error: Process completed with exit code 1.
```

Here is how the Actions workflow is configured:

``` yaml
name: Test GitHub Copilot CLI

on:
workflow_dispatch:
node_version:
description: Node.js Version
required: false
default: '24.x'
type: string

permissions:
contents: read

jobs:
copilot_cli_test:
name: Send test message
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node_version }}

- name: Install Copilot CLI
run: npm install -g @github/copilot

- name: Run Copilot CLI
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
copilot -p "Review the git log for this repository and write a bullet point summary of all code changes that were made today, with links to the relevant commit on GitHub. Above the bullet list give a description (max 100 words) summarizing the changes made. Write the details to summary.md" --allow-tool='shell(git:*)' --allow-tool=write --no-ask-user
cat summary.md >> "$GITHUB_STEP_SUMMARY"
```

The environment variable `COPILOT_GITHUB_TOKEN` was also considered on the test, that returns the same error.

Follow below the fine grained token created for the workflow:

Image

### Affected version

GitHub Copilot CLI 1.0.61.

### Steps to reproduce the behavior

The GitHub Action workflow is running in a repository that belongs to an organization.

1. Set the GitHub Action workflow secret in repository settings
2. Prepare the workflow file
3. Start workflow manually

Any feedback is highly appreciated.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by reproducing the supplied GitHub Actions workflow with Copilot CLI 1.0.61, testing GITHUB_TOKEN, COPILOT_GITHUB_TOKEN, and the fine-grained token in the organization-owned repository context. Review how the CLI reads authentication in this workflow environment; done means identifying the cause and confirming that the documented authentication path works or clearly documenting the limitation.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
github-actions, shell
領域
authentication, ci-cd, cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。