ci: deploy the docs with GITHUB_TOKEN instead of an expired PAT - #973
Merged
Merged
Conversation
Every push to master has failed at "Release to GitHub Pages" since the docs were last deployed on 2025-02-15: [command]/usr/bin/git push origin gh-pages remote: Invalid username or token. Password authentication is not supported for Git operations. fatal: Authentication failed for 'https://github.com/chartjs/chartjs-plugin-zoom.git/' The GH_AUTH_TOKEN secret is set but no longer valid: it is a classic PAT created on 2021-04-25 and never rotated since. The clone step still works because the repository is public, so only the push fails. The runner's own GITHUB_TOKEN can do this job - it gets Contents: write, and gh-pages is already the configured Pages source - so use it and drop the dependency on a human-owned token that can expire again. The deploying jobs now declare contents: write explicitly, so they no longer rely on the repository default workflow permission staying "write". The same secret was used by the three Pages steps in publish-npm.yml, which would have failed the same way on the next release. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
kurkle
force-pushed
the
ci-pages-github-token
branch
from
September 17, 2026 08:00
3ee8cb7 to
e39fb9b
Compare
Member
Author
|
@etimberg I do not recall why we have the org wide PAT in use. It seems to be expired.. But do we need that? |
etimberg
approved these changes
Sep 17, 2026
Member
Author
|
@etimberg this would also require removing the push limitation. So in addition to actions, maintainers would gain push access to pages. In my opinion that would be ok, when force pushed and deletions are disallowed. This is the reason we have the PAT. Rotating it would probably be fastest for all repositories, but I think it would have to be done yearly. Not ideal. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every push to
masterhas failed at Release to GitHub Pages in thedocumentationworkflow. All 21 runs still within the log retention window are red, and https://www.chartjs.org/chartjs-plugin-zoom/master/ has not been updated since the last successful deploy on 2025-02-15.The build itself is fine; only the push is rejected (latest run):
secrets.GH_AUTH_TOKENexists and is non-empty (the action logs[INFO] GithubToken: true), but GitHub rejects it. The repository secret was created on 2021-04-25 and has never been updated — a classic PAT that has since expired or been revoked. Thegh-pagesclone earlier in the same step still succeeds because the repository is public and that read needs no credentials.Fix
Use the runner's own
GITHUB_TOKENfor the fourpeaceiris/actions-gh-pagessteps. It is scoped to this repository, is minted per run, and cannot expire on us again. The failing run's token already hadContents: write, andgh-pagesis the configured Pages source (build_type: legacy), so peaceiris' "select the branch before the first deployment" caveat does not apply here.The deploying jobs now declare
permissions: contents: writeexplicitly, so the deploy no longer depends on the repository's default workflow permission staying at write.publish-npm.ymlused the same dead secret in its three Pages steps (version,latest,next), which would have failed the same way on the next release, so those are included.Verification
GET /repos/chartjs/chartjs-plugin-zoom/actions/secrets(created_at == updated_at == 2021-04-25).gh-releaseonly runs onpushtomaster. It will run on merge; if anything is still wrong there it will be visible immediately in thedocumentationrun for the merge commit.GH_AUTH_TOKENandGH_AUTH_EMAILare now unused in this repository and could be deleted, but this PR leaves them alone.🤖 Generated with Claude Code