For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /references/inputs/optional/github-token.md.
  • English
  • github-token

    Specify a GitHub Personal Access Token or secrets.GITHUB_TOKEN.

    By default, secrets.GITHUB_TOKEN is used.

    Caution

    The value entered for github-token is sensitive information, so use Secrets instead of writing it directly in a file.

    When it is used

    Depending on the granted permissions, it performs the following operations.

    • Creating and updating commit statuses
    • Creating and updating Deployments
    • Creating and updating pull request comments

    Required permissions

    If the required permissions are not granted, they are skipped and Vercel is deployed as usual. Grant and configure the permissions you need according to your preference.

    For secrets.GITHUB_TOKEN

    PermissionDescription
    deploymentsSet to write when creating and updating Deployments.
    statusesSet to write when creating and updating commit statuses.
    pull-requestsSet to write when creating pull request comments.
    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 }}
    

    For a Personal Access Token

    The repo scope is required.