Skip to content

Commit 9955d73

Browse files
authored
fix(ci): restore persist-credentials for gh-pages deploy (github-aws-runners#5162)
## Problem The `Deploy documentation to GitHub Pages` job has been failing on `main` (e.g. [run 27352324385](https://github.com/github-aws-runners/terraform-aws-github-runner/actions/runs/27352324385/job/80817419053)) with: ``` fatal: could not read Username for 'https://github.com': No such device or address subprocess.CalledProcessError: Command '['git', 'push', 'origin', 'gh-pages', '--force']' returned non-zero exit status 128. ``` ## Root cause In github-aws-runners#4808, `persist-credentials: false` was added to the `actions/checkout` step of the `deploy-pages` job as part of the zizmor hardening pass. `mkdocs gh-deploy` invokes `git push` internally via `ghp-import`, which relies on the credential helper / extraheader installed by `actions/checkout`. With `persist-credentials: false`, no token is configured, so the push prompts for a username and fails. The job has `contents: write` permission, so the token itself is sufficient — only the persisted credential is missing. ## Fix Set `persist-credentials: true` on the checkout step for this job and document why it is required. The token is only used to push to `gh-pages`, which the job already declares it needs via `permissions: contents: write`.
1 parent 83ea30c commit 9955d73

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/update-docs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ jobs:
113113

114114
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
115115
with:
116-
persist-credentials: false
116+
# mkdocs gh-deploy invokes `git push` internally via ghp-import, which relies on
117+
# the credentials persisted by actions/checkout to authenticate against gh-pages.
118+
persist-credentials: true
117119
- name: Configure Git Credentials
118120
run: |
119121
git config user.name github-actions[bot]

0 commit comments

Comments
 (0)