[WIP] Add explicit permissions to seven workflows#2609
Closed
Conversation
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.
Plan: Add Explicit Permissions to 7 Workflows
Based on the issue, I need to add explicit
permissions:declarations to 7 workflow files that currently lack them:Workflows to Update
Smoke Workflows (5 files) - Pattern: Read-only main job + safe-outputs
permissions: { contents: read, actions: read }permissions: { contents: read, actions: read }permissions: { contents: read, actions: read }permissions: { contents: read, actions: read }permissions: { contents: read, actions: read }Daily News Workflow - Pattern: Read + discussions write (non-strict mode)
permissions: { contents: read, discussions: write, actions: read }Notion Issue Summary - Pattern: Read-only
permissions: { contents: read, issues: read, actions: read }Validation Steps
gh aw compileKey Points
strict: truewithsafe-outputs.create-issue, so main job gets read-only permissionssafe-outputs.create-discussionbut NOT in strict mode, so requires explicit write permissionOriginal prompt
This section details on the original issue you should resolve
<issue_title>[q] Add explicit permissions to 7 workflows</issue_title>
<issue_description># Q Workflow Optimization Report
Investigation Summary
This PR is the result of a
/q investigate permissionscommand investigation into workflow permissions across the gh-aw repository, analyzing live workflow run data from the past 7 days.Issues Found (from live data)
Missing Explicit Permissions
Problem: 7 workflows lacked explicit
permissions:declarations, relying on GitHub Actions default permissions.Evidence from Live Runs:
copilot-permission-deniedWorkflows Without Explicit Permissions
Changes Made
Added Explicit Permissions
All 7 workflows now have explicit
permissions:declarations following the principle of least privilege:Smoke Workflows (5 files)
Pattern: Read-only main job + safe-outputs for write operations
Files modified:
smoke-copilot.mdsmoke-claude.mdsmoke-codex.mdsmoke-opencode.mdsmoke-copilot.firewall.mdKey Point: These workflows use
safe-outputs.create-issuewithstrict: true, so write permissions are handled by separate safe-outputs jobs.Daily News Workflow
Note: Uses
safe-outputs.create-discussionbut NOT in strict mode, so requires explicit write permission.Notion Issue Summary Workflow
Note: Read-only workflow, no safe-outputs used.
Validation
All modified workflows compiled successfully using
gh-aw compile:Expected Improvements
Security
Reliability
Maintainability
Key Learnings
strict: truecannot have write permissions in main jobInvestigation Details
Data Sources (all from live workflow runs - no fabricated data):
/tmp/gh-aw/aw-mcp/logs/References
gh aw logsMCP servergh aw compileMCP serverNote: This PR modifies only .md workflow files. Lock files (.lock.yml) will be regenerated automatically after merge.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.