Add explicit permissions to 7 workflows#2607
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add explicit permissions to seven workflows
Add explicit permissions to 7 workflows
Oct 27, 2025
pelikhan
reviewed
Oct 27, 2025
.github/workflows/daily-news.md
Outdated
| - cron: "0 9 * * 1-5" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: |
Contributor
Author
There was a problem hiding this comment.
Changed to permissions: read-all in b9fcf87
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds explicit permissions: declarations to 7 agentic workflows that were previously relying on GitHub Actions' default permissions, improving security through the principle of least privilege and preventing potential issues from future GitHub Actions default permission changes.
Key Changes
- Added explicit read-only permissions (
contents: read,actions: read,pull-requests: read) to 5 smoke test workflows - Added
permissions: read-allto the daily-news workflow based on review feedback - Added explicit read permissions to the notion-issue-summary workflow
- Minor documentation cleanup in the instructions file
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| smoke-opencode.md | Added explicit read-only permissions for contents, actions, and pull-requests |
| smoke-copilot.md | Added explicit read-only permissions for contents, actions, and pull-requests |
| smoke-copilot.firewall.md | Added explicit read-only permissions for contents, actions, and pull-requests |
| smoke-codex.md | Added explicit read-only permissions for contents, actions, and pull-requests |
| smoke-claude.md | Added explicit read-only permissions for contents, actions, and pull-requests |
| notion-issue-summary.md | Added explicit read-only permissions for contents, issues, and actions |
| daily-news.md | Added permissions: read-all as requested in review feedback |
| github-agentic-workflows.instructions.md | Simplified documentation examples by removing redundant content |
| *.lock.yml files | Automatically regenerated files reflecting the permission changes from corresponding .md files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
Copilot stopped work on behalf of
pelikhan due to an error
October 27, 2025 12:53
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.
Seven workflows lacked explicit
permissions:declarations, relying on GitHub Actions defaults. Analysis of workflow run #18840321667 showed permission-denied warnings in production.Changes
Smoke test workflows (5 files) - Read-only main job pattern with PR access:
smoke-copilot.mdsmoke-claude.mdsmoke-codex.mdsmoke-opencode.mdsmoke-copilot.firewall.mdThese use
strict: truewithsafe-outputs.create-issue, so write operations happen in separate jobs. Thepull-requests: readpermission is required for reading merged pull requests.Daily news workflow - Read-all permissions:
daily-news.mdUses
permissions: read-allto access all repository data including discussions, issues, and pull requests.Notion workflow - Read-only analysis:
notion-issue-summary.mdImpact
Original 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.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.