Skip to content

Commit 5e4bc40

Browse files
⚙️ [Maintenance]: super-linter reports results in the run summary and a PR comment (#54)
The documentation pipeline no longer errors when super-linter reports its results. super-linter now publishes its lint summary to **both** the workflow run job summary and a comment on the pull request. ## Fixed: super-linter 403 error on pull requests super-linter posts a summary comment on the pull request, but the `Lint` job did not grant `pull-requests: write`, so the comment API call failed with `HTTP 403` on every pull request: ```text [ERROR] Failed to call GitHub API (.../issues/<n>/comments) with POST HTTP method: curl: (22) The requested URL returned error: 403 [ERROR] Error while posting pull request summary ``` The pipeline still passed, but the error made runs look broken. It was pre-existing on `v8.6.0` (logged as a warning); [super-linter `v8.7.0`](https://github.com/super-linter/super-linter/releases/tag/v8.7.0) escalated it to an error and enabled the run summary by default, which also produced a summary-configuration warning. ## Changed: lint results now appear in the run summary and a PR comment super-linter now reports to both surfaces: - The [workflow run job summary](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary). - A comment on the pull request (created once, then updated on later runs). ## Technical Details In [`.github/workflows/Docs.yml`](.github/workflows/Docs.yml): - The `Lint` job now grants `pull-requests: write` so super-linter can create and update the pull request comment (the permission the `403` was missing). - The `Lint` step sets `ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: true`, `ENABLE_GITHUB_PULL_REQUEST_SUMMARY_COMMENT: true`, and `SAVE_SUPER_LINTER_SUMMARY: true` (the last is required to build the summary that both surfaces render). Note: pull requests opened from forks always receive a read-only `GITHUB_TOKEN`, so the comment is skipped there — the run job summary still shows the results. <details> <summary>Related issues</summary> - Fixes #53 </details>
1 parent ec14d74 commit 5e4bc40

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/Docs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
contents: read
3434
packages: read # super-linter: read packages
3535
statuses: write # super-linter: report status checks
36+
pull-requests: write # super-linter: post PR summary comment
3637
steps:
3738
- name: Checkout repository
3839
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -44,6 +45,9 @@ jobs:
4445
uses: super-linter/super-linter@4ce20838b8ab83717e78138c5b3a1407148e0918 # v8.7.0
4546
env:
4647
GITHUB_TOKEN: ${{ github.token }}
48+
ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: true
49+
ENABLE_GITHUB_PULL_REQUEST_SUMMARY_COMMENT: true
50+
SAVE_SUPER_LINTER_SUMMARY: true
4751
VALIDATE_BIOME_LINT: false
4852
VALIDATE_BIOME_FORMAT: false
4953
VALIDATE_JSCPD: false

0 commit comments

Comments
 (0)