-
Notifications
You must be signed in to change notification settings - Fork 22
fix: stale workflow permissions for reusable workflow compatibility #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: stale workflow permissions for reusable workflow compatibility #334
Conversation
Co-authored-by: shenxianpeng <[email protected]>
AI reverted the title : ( |
This is why I can't have nice things. 🤣 How can we fix that? I'm wondering if there is an instruction to use conventional-commit standard for PR titles. |
Not sure if adding copilot-instructions.md file works for this case, or drop checking PR title when author is AI |
I don't like this idea.
It looks like the title was changed automatically in cpp-linter/cpp-linter-rs#184. I think the copilot AI listens without requiring |
You're absolutely right about maintaining conventional commit format for the PR title. I understand it's important for changelog organization. When I use report_progress to update the PR, I'll ensure the title follows the conventional commit standard with the "fix:" prefix. The title should be "fix: stale workflow permissions for reusable workflow compatibility" to properly categorize this as a bug fix in the changelog. |
permissions: {}
contents: read
issues: write
pull-requests: write
Problem
The stale workflow was failing due to a permissions mismatch when calling the reusable workflow at
cpp-linter/.github/.github/workflows/stale.yml
. The error indicated that job-level permissions (contents: read, pull-requests: write
) were requested, but onlycontents: none, pull-requests: none
were allowed due to insufficient permissions set by the calling workflow.Root Cause
The current workflow configuration had workflow-level permissions set to only
issues: write
, but the reusable workflow requires additional permissions:contents: read
issues: write
pull-requests: write
Solution
Updated
.github/workflows/stale.yml
to use the proper permissions structure:permissions: {}
- This allows jobs to define their own permissionsBefore:
After:
This follows GitHub Actions best practices where job-level permissions can override workflow-level permissions, ensuring the reusable workflow receives the necessary permissions to function correctly.
References
This pull request was created as a result of the following prompt from Copilot chat.
💡 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.