> ## 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 pour Laravel

> Explique comment installer le Copilot CLI et configurer l'authentification par token pour utiliser Laravel Copilot SDK dans GitHub Actions.

## Utilisation dans GitHub Actions

Exemple d'exécution d'une commande Artisan utilisant le Copilot CLI depuis GitHub Actions.

Sur GitHub Actions, il est habituel d'utiliser le mode stdio.

## Installer directement la commande `copilot`

```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 }}
```

* Installez via `copilot-install`. Aucune configuration supplémentaire n'est nécessaire, le chemin reste `copilot`.
* Authentifiez-vous avec `COPILOT_GITHUB_TOKEN`. Toute méthode d'authentification prise en charge par le Copilot CLI (`GH_TOKEN`, `GITHUB_TOKEN`, etc.) convient.
* Le token doit disposer de la permission `Copilot Requests` ; le `GITHUB_TOKEN` par défaut ne convient probablement pas.

## Utiliser la commande `gh`

GitHub CLI 2.86.0 a ajouté la possibilité d'installer Copilot. Dans un environnement GitHub Actions standard, `gh` est préinstallé, donc aucune installation supplémentaire n'est requise. Comme Copilot est probablement installé automatiquement la première fois qu'une commande `gh copilot ...` est exécutée, on lance simplement `gh copilot version`.

> 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` bénéficie d'un traitement spécial uniquement pour `gh copilot` ; toute autre configuration ne fonctionnera pas.

<Info>
  Pour les dernières informations, consultez le [dépôt GitHub](https://github.com/invokable/laravel-copilot-sdk).
</Info>


## Related topics

- [GitHub Copilot SDK pour Laravel](/fr/packages/laravel-copilot-sdk/index.md)
- [Authentification - GitHub Copilot SDK pour Laravel](/fr/packages/laravel-copilot-sdk/auth.md)
- [Démarrer - GitHub Copilot SDK pour Laravel](/fr/packages/laravel-copilot-sdk/getting-started.md)
- [Tests - GitHub Copilot SDK pour Laravel](/fr/packages/laravel-copilot-sdk/fake.md)
- [Laravel Cloud - GitHub Copilot SDK pour Laravel](/fr/packages/laravel-copilot-sdk/laravel-cloud.md)
