Skip to content

CI: Set persist-credentials to true to allow pushing to the gh-pages branch #3867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

seisman
Copy link
Member

@seisman seisman commented Mar 24, 2025

The "Docs" workflow failed to upload the built HTML files to the gh-pages branch since PR #3861.

The git push -fq origin gh-pages command failed with errors like below (https://github.com/GenericMappingTools/pygmt/actions/runs/13937126371/job/39007072378#step:14:4408):

fatal: could not read Username for 'https://github.com/': No such device or address

but the workflow step doesn't fail. That's why we didn't catch it in PR #3861.

The command fails because we set persist-credentials to false in that PR. This PR fixes the issue.

@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Mar 24, 2025
@seisman seisman added this to the 0.15.0 milestone Mar 24, 2025
@seisman seisman requested a review from weiji14 March 24, 2025 11:59
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the workflow step doesn't fail. That's why we didn't catch it in PR #3861.

Good catch, I knew there had to be at least one job that required extra permissions 😆

@weiji14 weiji14 merged commit 141a9d4 into main Mar 24, 2025
11 of 12 checks passed
@weiji14 weiji14 deleted the ci/docs-persist-credentials branch March 24, 2025 19:52
@seisman
Copy link
Member Author

seisman commented Mar 25, 2025

Hmm, it still doesn't work, but now with different error (https://github.com/GenericMappingTools/pygmt/actions/runs/14044608036/job/39322435789#step:14:4472):

Pushing changes to gh-pages.
remote: Permission to GenericMappingTools/pygmt.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/GenericMappingTools/pygmt/': The requested URL returned error: 403

@seisman
Copy link
Member Author

seisman commented Mar 25, 2025

It's likely due to the permissions: {} setting added in PR #3861, which disables all permissions for GITHUB_TOKEN.

@seisman
Copy link
Member Author

seisman commented Mar 25, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants