Skip to content

Move GitHub Pages configuration check to Python code#53

Merged
manuq merged 2 commits intomainfrom
push-ypsvmqqkxruv
Aug 6, 2025
Merged

Move GitHub Pages configuration check to Python code#53
manuq merged 2 commits intomainfrom
push-ypsvmqqkxruv

Conversation

@wjt
Copy link
Member

@wjt wjt commented Aug 6, 2025

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

wjt added 2 commits August 6, 2025 18:21
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
@wjt wjt requested a review from manuq August 6, 2025 17:34
Copy link
Contributor

@manuq manuq left a comment

Choose a reason for hiding this comment

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

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"'
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

@manuq manuq merged commit 5bc536d into main Aug 6, 2025
1 check passed
@manuq manuq deleted the push-ypsvmqqkxruv branch August 6, 2025 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments