From 909035a689a677a0ac642e040a8639e7e4a2ae6a Mon Sep 17 00:00:00 2001 From: mcaulifn <16712138+mcaulifn@users.noreply.github.com> Date: Wed, 2 Dec 2026 09:17:22 -0500 Subject: [PATCH] fix(ci): use GITHUB_TOKEN to check out the docs job The docs job checks out the pull request branch with a token taken from secrets.GH_PERSONAL_ACCESS_TOKEN, falling back to GITHUB_TOKEN only when that secret is empty. When the PAT is set but no longer valid, the fetch is rejected and the job fails with 'could not read Username'. Use GITHUB_TOKEN and grant the job contents: write so terraform-docs can still push. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f8e6bd8..75a4280 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -51,12 +51,14 @@ jobs: docs: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v7 with: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN || secrets.GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Terraform Docs uses: terraform-docs/gh-actions@v1.4.1