fix(ci): fall back to github.token when GH_TOKEN secret is not set

When secrets.GH_TOKEN is not configured, ${{ secrets.GH_TOKEN }} evaluates
to an empty string and actions/checkout@v4 fails with:
  "Input required and not supplied: token"

Using ${{ secrets.GH_TOKEN || github.token }} ensures the workflow always
has a valid token. GH_TOKEN (PAT) is preferred when available since it can
push branches and create PRs; github.token is used as a safe fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Julio Quinteros Pro 2026-02-19 19:51:17 -03:00
parent 8edc6effb1
commit a233baa1d4

View file

@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
token: ${{ secrets.GH_TOKEN || github.token }}
- name: Set up Python
uses: actions/setup-python@v5
@ -74,4 +74,4 @@ jobs:
--head "$BRANCH" \
--base main
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }}