Repository navigation
fix: add explicit permissions to all GitHub Actions workflows - #693
Merged
Zee2413 merged 1 commit intoMar 30, 2026
Merged
Conversation
Add top-level permissions blocks to restrict GITHUB_TOKEN scope, resolving 24 CodeQL code-scanning alerts (actions/missing-workflow-permissions). Without explicit permissions, workflows get the repo's default token permissions, which is typically overly broad. This follows the principle of least privilege — if a compromised action runs, it only has the minimum access needed. - action-ci.yml: contents: read - pr.yml: contents: read - pre-commit.yml: contents: read - release.yml: contents: read (jobs needing write already have explicit blocks) - security_audit.yml: contents: read, security-events: write - typescript_library.yml: contents: read
Zee2413
force-pushed
the
fix/workflow-permissions
branch
from
March 30, 2026 18:10
50a0ce6 to
7c12be1
Compare
deepfuriya
approved these changes
Mar 30, 2026
chrisqm-dev
approved these changes
Mar 30, 2026
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
cloudformation-guard 3.2.1 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre><!-- Release notes generated using configuration in .github/release.yml at 3.2.1 --> ## What's Changed * Use remote check for tag and force-with-lease for branch to allow rel… by @Zee2413 in aws-cloudformation/cloudformation-guard#675 * Fetch before pushing release branch by @Zee2413 in aws-cloudformation/cloudformation-guard#676 * Remove homebrew step and skip scratch compilation during cargo publish by @Zee2413 in aws-cloudformation/cloudformation-guard#678 * Prevent cargo publish errors from being swallowed as already published by @Zee2413 in aws-cloudformation/cloudformation-guard#680 * fix: exclude bot authors from release notes and prevent duplication o… by @Zee2413 in aws-cloudformation/cloudformation-guard#682 * fix: bump form-data to 4.0.5 to resolve CVE-2025-7783 (Dependabot #46) by @Zee2413 in aws-cloudformation/cloudformation-guard#685 * fix: resolve npm audit vulnerabilities in action/ and replace dead gitpkg dependency by @Zee2413 in aws-cloudformation/cloudformation-guard#691 * fix: resolve 9 npm audit vulnerabilities in guard/ dev dependencies by @Zee2413 in aws-cloudformation/cloudformation-guard#690 * fix: add explicit permissions to all GitHub Actions workflows by @Zee2413 in aws-cloudformation/cloudformation-guard#693 * fix: upgrade @actions/github to 8.0.1 and @actions/core to 2.0.3 to resolve undici CVEs by @Zee2413 in aws-cloudformation/cloudformation-guard#695 * fix: bump bytes crate to 1.11.1 to resolve CVE-2026-25541 by @Zee2413 in aws-cloudformation/cloudformation-guard#694 * chore: automate ATTRIBUTION generation with cargo-about by @Zee2413 in aws-cloudformation/cloudformation-guard#697 * chore(deps): Fix high severity npm audit findings in /action and /guard by @Zee2413 in aws-cloudformation/cloudformation-guard#711 * Fix evaluator and reporter defects where a rule reported compliance, or nothing at all, for input it should have rejected by @awsmadi in aws-cloudformation/cloudformation-guard#717 * fix(deps): Patch high-severity advisories by @Zee2413 in aws-cloudformation/cloudformation-guard#724 * fix(deps): Update undici to 6.28.0 by @Zee2413 in aws-cloudformation/cloudformation-guard#726 ## New Contributors * @github-actions[bot] made their first contribution in aws-cloudformation/cloudformation-guard#681 * @awsmadi made their first contribution in aws-cloudformation/cloudformation-guard#717 **Full Changelog**: https://github.com/aws-cloudformation/cloudformation-guard/compare/3.2.0...3.2.1</pre> <p>View the full release notes at <a href="https://github.com/aws-cloudformation/cloudformation-guard/releases/tag/3.2.1">https://github.com/aws-cloudformation/cloudformation-guard/releases/tag/3.2.1</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!17668
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.
Summary
Resolves all 24 open CodeQL code-scanning alerts for
actions/missing-workflow-permissions.Problem
Without an explicit
permissionsblock, theGITHUB_TOKENin each workflow gets the repository's default permissions, which is typically read/write on all scopes. This violates the principle of least privilege — if a compromised or malicious action runs in any of these workflows, it has more access than necessary.Fix
Added a top-level
permissions: { contents: read }block to each workflow file, restricting the token to the minimum required scope:action-ci.ymlcontents: readpr.ymlcontents: readpre-commit.ymlcontents: readrelease.ymlcontents: readsecurity_audit.ymlcontents: readtypescript_library.ymlcontents: readAll workflows only need read access to check out code and run builds/tests. Jobs in
release.ymlthat require elevated permissions (version-bump,github-release,publish-docker) already have explicit job-levelpermissionsblocks that override the workflow-level default.Alerts Resolved
24 medium-severity CodeQL alerts across 6 workflow files.