fix: stale workflow permissions for reusable workflow compatibility#334
Conversation
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
|
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: readissues: writepull-requests: writeProblem
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: nonewere 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: readissues: writepull-requests: writeSolution
Updated
.github/workflows/stale.ymlto 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.