Skip to content

Comments

Fix invalid administration permission scope in branch-protection workflow#26

Merged
leeoades merged 2 commits intomainfrom
copilot/fix-branch-protection-yml
Feb 20, 2026
Merged

Fix invalid administration permission scope in branch-protection workflow#26
leeoades merged 2 commits intomainfrom
copilot/fix-branch-protection-yml

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

The branch-protection.yml workflow was failing at validation time with 0 jobs created (conclusion: failure) because administration is not a valid GITHUB_TOKEN scope in GitHub Actions.

What was wrong

administration is a GitHub Apps repository permission — it has no effect in a workflow permissions: block and causes the entire workflow run to be rejected before any jobs are queued.

What enforce_admins: true already does

The apparent intent behind administration: write was misplaced. Whether the repo admin is subject to branch protection is controlled by enforce_admins in the updateBranchProtection API call — not the workflow permissions block:

  • enforce_admins: true → admin must also use PRs (already set, intentional for securing main)
  • enforce_admins: false → admin is exempt from branch protection

Fix

Removed the invalid administration: write line. No other changes needed — for a personal repository the GITHUB_TOKEN already runs with owner-level access and can call updateBranchProtection without any additional scope.

# Before
permissions:
  contents: read
  administration: write  # not a valid GITHUB_TOKEN scope → 0 jobs, workflow fails

# After
permissions:
  contents: read

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: leeoades <2321091+leeoades@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error in branch protection configuration Fix invalid permission scope in branch-protection.yml causing workflow to never run Feb 20, 2026
Copilot AI requested a review from leeoades February 20, 2026 09:05
Copilot AI changed the title Fix invalid permission scope in branch-protection.yml causing workflow to never run Fix invalid administration permission scope in branch-protection workflow Feb 20, 2026
@leeoades leeoades marked this pull request as ready for review February 20, 2026 09:26
@leeoades leeoades merged commit 74f29c0 into main Feb 20, 2026
1 check passed
@leeoades leeoades deleted the copilot/fix-branch-protection-yml branch February 20, 2026 09:26
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