Repository navigation
fix(ci): restore checks: write on lint job for reviewdog annotations - #2500
Merged
Merged
Conversation
PR #2487 added the first workflow-level `permissions:` block to `.github/workflows/test.yml` to grant `packages: read` for ghcr.io OCI pulls. Before that, the file inherited the repo default permissions, which include `security-events: write`. Declaring an explicit `permissions:` block stops GitHub from merging in defaults, so `security-events: write` was silently stripped from every job — and the `[lint] Dockerfile` job's `github/codeql-action/upload-sarif@v4` step started failing with "Resource not accessible by integration". Add a job-scoped `permissions:` block on `docker` granting `contents: read` + `security-events: write`. Job-scoped (least privilege) matches the convention used in `.github/workflows/codeql.yml`, and avoids giving the rest of the matrix jobs a token that can write code-scanning alerts. Failing run: https://github.com/cloudposse/atmos/actions/runs/26348559800/job/77599880970
Erik Osterman (Cloud Posse) (osterman)
requested a review
from a team
as a code owner
May 24, 2026 14:59
Contributor
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
Contributor
|
Important Cloud Posse Engineering Team Review RequiredThis pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes. To expedite this process, reach out to us on Slack in the |
`reviewdog/action-tflint@v1` defaults to the `github-pr-check` reporter, which calls the GitHub Checks API to post inline tflint findings on the PR. That requires `checks: write` on the job's GITHUB_TOKEN. Before PR #2487 the lint job inherited the repo's default scopes (which include `checks: write`), so reviewdog annotations worked. Once that PR introduced an explicit workflow-level `permissions:` block (`contents: read` + `packages: read`), the inherited defaults were stripped from every job. The lint job did not hard-fail because reviewdog silently falls back to local-only output, but PR-line annotations stopped appearing. Add a job-scoped `permissions:` block on `lint` granting `contents: read` (checkout) + `checks: write` (reviewdog). Job-scoped (least privilege) — only this job needs to write checks. Not adding `pull-requests: write`: the default `github-pr-check` reporter posts check runs, not review comments, so `checks: write` alone is enough.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2500 +/- ##
==========================================
+ Coverage 78.30% 78.33% +0.03%
==========================================
Files 1119 1119
Lines 106684 106684
==========================================
+ Hits 83539 83572 +33
+ Misses 18479 18446 -33
Partials 4666 4666
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Contributor
|
💥 This pull request now has conflicts. Could you fix it Erik Osterman (Cloud Posse) (@osterman)? 🙏 |
…ission-check # Conflicts: # .github/workflows/test.yml
Andriy Knysh (aknysh)
approved these changes
May 24, 2026
Contributor
|
These changes were released in v1.220.0-rc.2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
permissions:block on thelint([lint] <demo-folder>) job in.github/workflows/test.ymlgrantingcontents: read+checks: writesoreviewdog/action-tflint@v1can post inline tflint findings on PRs via the GitHub Checks API.why
permissions:block ontest.ymlto grantpackages: readfor ghcr.io OCI pulls. A workflow-levelpermissions:block replaces (not extends) the defaultGITHUB_TOKENscope for every job in the file, which silently stripped the inheritedchecks: writethat thelintjob relied on.examples/<demo-folder>/components/terraformhave stopped appearing as inline check annotations. The job itself still exits with the right code (fail_level: errorcontrols that), but reviewers lost the per-line context. This restores that behavior..github/workflows/codeql.ymland thedocker-job fix already landed in fix(ci): restore security-events: write for Dockerfile lint SARIF upload #2499.pull-requests: write: reviewdog's defaultgithub-pr-checkreporter posts check runs (which needchecks: write), not review comments.checks: writealone is sufficient.references
2437e13bf, "fix(vendor): recover OCI pulls on auth rejection and surface rich errors").fix(ci): restore security-events: write for Dockerfile lint SARIF upload).