メインコンテンツへスキップ

Documentation Index

Fetch the complete documentation index at: https://kawax.biz/llms.txt

Use this file to discover all available pages before exploring further.

GitHub Actions での使い方

GitHub Actions で Artisan コマンドを実行してその中で Copilot CLI を使う例です。 GitHub Actions では stdio モードで使うのが一般的です。

copilot コマンドを直接インストールする場合

      - name: Install Copilot CLI
        run: |
          curl -fsSL https://gh.io/copilot-install | bash
          copilot version

      - name: Run command
        run: php artisan copilot:ping
        env:
          COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
  • copilot-install を使ってインストールします。path は copilot のまま追加の設定不要で使えます。
  • COPILOT_GITHUB_TOKEN で認証します。GH_TOKENGITHUB_TOKEN など Copilot CLI がサポートしている認証方法ならなんでもよいです。
  • トークンは Copilot Requests の権限が必要なのでデフォルトの GITHUB_TOKEN ではおそらく使えません。

gh コマンドを使う場合

GitHub CLI 2.86.0 で Copilot のインストール機能が追加されました。普通の GitHub Actions 環境では gh コマンドがプリインストールされているので追加のインストール不要で使えます。おそらく最初に gh copilot ... コマンドが実行された時に Copilot が自動でインストールされるので gh copilot version だけ実行します。
gh version 2.86.0 (2026-01-21) https://github.com/cli/cli/releases/tag/v2.86.0 ✓ Copilot CLI installed successfully
      - name: Install Copilot CLI
        run: |
          gh --version
          gh copilot version

      - name: Run command
        run: php artisan copilot:ping
        env:
          COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
          COPILOT_CLI_PATH: "gh copilot"
COPILOT_CLI_PATHgh copilot の時のみ特別な対応をしているので、gh copilot 以外の設定では動きません。
最新情報は GitHub リポジトリ を参照してください。
Last modified on April 29, 2026