Skip to content

🪲 [Fix]: Super-linter can now post PR comment summaries#308

Merged
Marius Storhaug (MariusStorhaug) merged 1 commit intomainfrom
fix/307-lint-repo-pr-write-permission
Apr 5, 2026
Merged

🪲 [Fix]: Super-linter can now post PR comment summaries#308
Marius Storhaug (MariusStorhaug) merged 1 commit intomainfrom
fix/307-lint-repo-pr-write-permission

Conversation

@MariusStorhaug
Copy link
Copy Markdown
Member

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.yml reusable workflow's permissions: block only granted contents: read and statuses: write, omitting the pull-requests: write permission needed by the GitHub Issues API to create comments.

The error looked like this in the Actions log:

[WARN] Failed to call GitHub API: curl: (22) The requested URL returned error: 403
[WARN] Failed to create GitHub issue comment
[WARN] Error while posting pull request summary

Lint failures are still correctly reported — only the inline PR comment was missing.

Technical Details

  • Added pull-requests: write to the permissions: block in .github/workflows/Lint-Repository.yml.
  • When a reusable workflow defines its own permissions: block, it overrides (not inherits) the calling workflow's permissions. The parent workflows (workflow.yml and consumer repos) already grant pull-requests: write, but Lint-Repository.yml was restricting the GITHUB_TOKEN to a narrower scope.
  • No other workflows or jobs are affected — the permission is scoped to the lint job only.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

No Significant Changes Detected

This PR does not contain changes to files that would trigger a new release:

Path Description
src/** Module source code
README.md Documentation

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
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

No Significant Changes Detected

This PR does not contain changes to files that would trigger a new release:

Path Description
src/** Module source code
README.md Documentation

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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@MariusStorhaug Marius Storhaug (MariusStorhaug) marked this pull request as ready for review April 4, 2026 22:29
Copilot AI review requested due to automatic review settings April 4, 2026 22:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: write to .github/workflows/Lint-Repository.yml so super-linter can create PR summary comments when lint errors occur.

@MariusStorhaug Marius Storhaug (MariusStorhaug) merged commit 205d193 into main Apr 5, 2026
52 of 53 checks passed
@MariusStorhaug Marius Storhaug (MariusStorhaug) deleted the fix/307-lint-repo-pr-write-permission branch April 5, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pull-requests: write permission to Lint-Repository workflow

2 participants