> For AI agents: the complete documentation index is available at /ja/llms.txt, the full documentation bundle is available at /ja/llms-full.txt.

# `github-token`

GitHubのPersonal Access Tokenまたは`secrets.GITHUB_TOKEN`を指定してください。

デフォルトでは、**secrets.GITHUB\_TOKEN**を使用します。

::: danger 注意
`github-token`に入力する値は**機密情報**になるので、直接ファイルに記述せず[Secrets](/ja/guide/getting-started.md#github-secrets)を利用してください。
:::

## 使用する場面

与えられた権限に応じて、以下のような操作を行います。

- コミットステータスの作成、更新
- Deploymentの作成、更新
- プルリクエストへのコメント作成、更新

## 必要な権限

必要な権限が与えられていない場合は、スルーして通常通りVercelへのデプロイを行う仕組みになっています。お好みに合わせて必要な権限を与えて設定してください。

### `secrets.GITHUB_TOKEN`の場合

| 権限              | 説明                             |
| --------------- | ------------------------------ |
| `deployments`   | デプロイメントを作成、更新する場合は`write`に設定   |
| `statuses`      | コミットステータスを作成、更新する場合は`write`に設定 |
| `pull-requests` | プルリクエストにコメントを作成する場合は`write`に設定 |

```yaml {18-20,31} file="/snippets/references/inputs/github-token.yml"
name: Vercel

on:
  push:
    branches: [main]
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    permissions:
      contents: read
      deployments: write
      statuses: write
      pull-requests: write

    steps:
      - uses: actions/checkout@v7

      - uses: nexterias/actions-vercel@v2
        with:
          token: ${{ secrets.VERCEL_TOKEN }}
          org-id: ${{ secrets.VERCEL_ORG_ID }}
          project-id: ${{ secrets.VERCEL_PROJECT_ID }}
          production: ${{ github.ref == 'refs/heads/main' }}
          github-token: ${{ secrets.GITHUB_TOKEN }}

```

### Personal Access Tokenの場合

`repo`スコープが必要です。
