🪲 [Fix]: Super-linter can now post PR comment summaries#308
Conversation
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
1 similar comment
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
There was a problem hiding this comment.
Pull request overview
This PR fixes super-linter’s inability to post inline pull request summary comments by expanding the reusable lint workflow’s GITHUB_TOKEN permissions to include PR write access, aligning the reusable workflow’s permissions with what calling workflows already grant.
Changes:
- Added
pull-requests: writeto.github/workflows/Lint-Repository.ymlso super-linter can create PR summary comments when lint errors occur.
Super-linter's inline PR comment summaries now appear when lint errors are found. Previously, the linter detected issues but silently failed to post the summary comment, requiring developers to navigate to the Actions log to see what went wrong.
Fixed: Lint error summaries now visible directly on PRs
When super-linter detects markdown, YAML, or other linting issues, it posts a summary comment on the pull request for quick feedback. This was failing with a 403 error because the
Lint-Repository.ymlreusable workflow'spermissions:block only grantedcontents: readandstatuses: write, omitting thepull-requests: writepermission needed by the GitHub Issues API to create comments.The error looked like this in the Actions log:
Lint failures are still correctly reported — only the inline PR comment was missing.
Technical Details
pull-requests: writeto thepermissions:block in.github/workflows/Lint-Repository.yml.permissions:block, it overrides (not inherits) the calling workflow's permissions. The parent workflows (workflow.ymland consumer repos) already grantpull-requests: write, butLint-Repository.ymlwas restricting theGITHUB_TOKENto a narrower scope.