Move GitHub Pages configuration check to Python code#53
Merged
Conversation
I don't expect this to change but it's a little less typing each time.
Previously, the check was done in a shell script in the action YAML. I rewrote this check in Python as part of trying to automatically fix the configuration before realising that workflow jobs don't have enough permissions to do this. The rewrite is longer but I think clearer. Helps endlessm/threadbare#991
manuq
approved these changes
Aug 6, 2025
Contributor
manuq
left a comment
There was a problem hiding this comment.
Yes, the check is much clear in Python than in Bash, nice!
| GH_TOKEN: ${{ github.token }} | ||
| shell: bash | ||
| run: | | ||
| if ! gh api "repos/${{ github.repository }}/pages" | jq --exit-status '.build_type == "workflow"' |
Contributor
There was a problem hiding this comment.
Are gh or jq dependencies we can now remove? I guess no because I don't see them listed in this composite action, so they must be part of ubuntu-latest.
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.
Previously, the check was done in a shell script in the action YAML.
I rewrote this check in Python as part of trying to automatically fix
the configuration before realising that workflow jobs don't have enough
permissions to do this.
The rewrite is longer but I think clearer.
See endlessm/threadbare#991