> ## 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 Copilot SDK voor Laravel

> Leer hoe je de Copilot CLI installeert en tokenauthenticatie instelt om de Laravel Copilot SDK in GitHub Actions te gebruiken.

## Gebruik in GitHub Actions

Een voorbeeld waarbij je in GitHub Actions een Artisan-command uitvoert dat de Copilot CLI gebruikt.

In GitHub Actions is het gebruikelijk om de stdio-modus te gebruiken.

## Het `copilot`-commando direct installeren

```yaml theme={null}
      - 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 }}
```

* Installeer met `copilot-install`. Het pad blijft gewoon `copilot`, dus je kunt het zonder extra configuratie gebruiken.
* Authenticeer via `COPILOT_GITHUB_TOKEN`. Elke authenticatiemethode die de Copilot CLI ondersteunt is prima, zoals `GH_TOKEN` of `GITHUB_TOKEN`.
* Het token heeft de permissie `Copilot Requests` nodig, dus met het standaard `GITHUB_TOKEN` werkt het waarschijnlijk niet.

## Het `gh`-commando gebruiken

In GitHub CLI 2.86.0 is een installatiefunctie voor Copilot toegevoegd. In een normale GitHub Actions-omgeving is het `gh`-commando voorgeïnstalleerd, dus je kunt het zonder extra installatie gebruiken. Copilot wordt waarschijnlijk automatisch geïnstalleerd zodra het eerste `gh copilot ...`-commando wordt uitgevoerd, dus je voert alleen `gh copilot version` uit.

> gh version 2.86.0 (2026-01-21)
> [https://github.com/cli/cli/releases/tag/v2.86.0](https://github.com/cli/cli/releases/tag/v2.86.0)
> ✓ Copilot CLI installed successfully

```yaml theme={null}
      - 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_PATH` heeft alleen voor `gh copilot` een speciale afhandeling, dus met andere waarden dan `gh copilot` werkt dit niet.

<Info>
  Raadpleeg de [GitHub-repository](https://github.com/invokable/laravel-copilot-sdk) voor de meest actuele informatie.
</Info>


## Related topics

- [GitHub Copilot SDK voor Laravel](/nl/packages/laravel-copilot-sdk/index.md)
- [GitHub-token](/nl/packages/laravel-copilot-sdk/github-token.md)
- [Testen - GitHub Copilot SDK voor Laravel](/nl/packages/laravel-copilot-sdk/fake.md)
- [Laravel Cloud - GitHub Copilot SDK voor Laravel](/nl/packages/laravel-copilot-sdk/laravel-cloud.md)
- [Authenticatie - GitHub Copilot SDK for Laravel](/nl/packages/laravel-copilot-sdk/auth.md)
