ci: declare contents:read on slack-alert workflow#205
Open
arpitjain099 wants to merge 1 commit into
Open
Conversation
slack-alert runs on workflow_run, which executes with the elevated default-branch context (not the read-only pull_request context). The job only posts to a Slack webhook via SLACK_WEBHOOK_URL; it never calls the GitHub API. Pinning the workflow to contents:read makes the minimum-scope contract explicit, matching release.yml and website.yml which already declare permissions blocks. tests.yml uses actions/cache and is therefore left for a separate change to avoid muddling the cache-write semantics here. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
Coverage Report for CI Build 631Coverage remained the same at 96.954%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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.
The
slack-alertworkflow triggers onworkflow_run, which runs with the same default-branch context thatpushevents use, not the read-only context used forpull_requestfrom forks. Right now there's no explicitpermissions:block on this workflow, so the token receives whatever the repo default grants.The job itself only calls
slackapi/slack-github-action@v2.1.1withSLACK_WEBHOOK_URL. It never invokes the GitHub API or touches the repo, so pinning the workflow tocontents: readmakes the minimum-scope intent explicit. This narrows the blast radius if the third-party Slack action is ever compromised (cf. tj-actions/changed-files CVE-2025-30066).Style matches release.yml and website.yml, which already carry explicit
permissions:blocks.I deliberately left tests.yml out of this patch: it uses
actions/cache, and that interacts with the explicit-permissions story in a way I'd rather handle separately if you want it tightened up too. Happy to follow up.