Commit 5e4bc40
authored
⚙️ [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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
0 commit comments