-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Labels
Description
Objective
Add missing issues: read and pull-requests: read permissions to workflows that use GitHub API toolsets but lack required permissions.
Context
Tool: compiler warnings
Count: 4 workflows affected
Issue: Workflows using GitHub toolsets without proper permissions will fail at runtime
When workflows use the GitHub MCP server or GitHub API toolsets, they require explicit permissions to access issues and pull requests. Without these permissions, API calls will fail with 403 Forbidden errors.
Affected Workflows
.github/workflows/ai-moderator.md- missingissues: read,pull-requests: read.github/workflows/daily-choice-test.md- missingpull-requests: read.github/workflows/duplicate-code-detector.md- missingissues: read,pull-requests: read.github/workflows/example-custom-error-patterns.md- missingissues: read,pull-requests: read
Approach
For each workflow:
- Open the workflow markdown file
- Locate the
permissions:section in the frontmatter (or add one if missing) - Add the missing permissions based on which toolsets are being used
- Ensure permissions follow least-privilege principle (read-only unless write needed)
- Compile and validate the workflow
Files to Modify
.github/workflows/ai-moderator.md.github/workflows/daily-choice-test.md.github/workflows/duplicate-code-detector.md.github/workflows/example-custom-error-patterns.md
Example Fix
Before:
---
engine: copilot
tools:
github:
mode: remote
toolsets: [issues, pull_requests]
permissions:
contents: read
---After:
---
engine: copilot
tools:
github:
mode: remote
toolsets: [issues, pull_requests]
permissions:
contents: read
issues: read
pull-requests: read
---Acceptance Criteria
- All 4 workflows have correct permissions added
- Workflows compile successfully with
make recompile - No compiler warnings about missing permissions for these workflows
- Permissions follow least-privilege principle
- Workflows can successfully access GitHub API resources
Testing
# Recompile all affected workflows
make build
./gh-aw compile .github/workflows/ai-moderator.md
./gh-aw compile .github/workflows/daily-choice-test.md
./gh-aw compile .github/workflows/duplicate-code-detector.md
./gh-aw compile .github/workflows/example-custom-error-patterns.md
# Verify no permission warnings
make recompile 2>&1 | grep -i "missing-permissions"Related to #9990
AI generated by Plan Command for discussion #9966
Copilot