Skip to content

Extend check-github-config to cover Actions default workflow permissions #161

Description

@ineedjet

Ask

Extend check-github-config (and config/github.yml) to also check the Actions "Workflow permissions" repo settings: default_workflow_permissions and can_approve_pull_request_reviews.

Why

In rubykatzen/flightdeck, a silently-restrictive default_workflow_permissions: "read" (with can_approve_pull_request_reviews: false) broke two workflows completely for weeks without anyone noticing:

  • Releaseaction_required, zero jobs ever ran, even though the workflow explicitly declares permissions: contents: write / issues: write / pull-requests: write itself. The repo-level setting is a hard ceiling; a workflow's own permissions: block can only narrow it, never exceed it.
  • Notify Telegram PRstartup_failure on every run, including the daily schedule trigger (so this wasn't a PR/fork-specific thing), because a nested reusable-workflow job needed pull-requests: read and the repo only allowed pull-requests: none.

Both were silent config drift — exactly the class of problem check-github-config already exists to catch for hasWikiEnabled/deleteBranchOnMerge/etc. Would've caught this in CI instead of us reverse-engineering it from GitHub's error banners after the fact.

Technical note

These two fields aren't exposed via GraphQL on the Repository type (checked the schema — no defaultWorkflowPermissions/canApprovePullRequestReviews-shaped field exists there). They're REST-only, under GET /repos/{owner}/{repo}/actions/permissions/workflow. check-github-config's current mechanism (github_repository() in check.py) is a single GraphQL query against arbitrary Repository field names, so this isn't just another key under config/github.yml's config: mapping — it needs a second, REST-based check path alongside the existing GraphQL one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions