missing-permissions
What it does
Section titled “What it does”Reports a job with no permissions, in a workflow with no top-level permissions.
Why it matters
Section titled “Why it matters”Without permissions, the GITHUB_TOKEN gets the default of the repository or organization, which for older repositories is read and write on most scopes. A compromised step or action then has more access than the job needs.
To fix, set permissions with only the scopes the job uses, for example contents: read.
Example
Section titled “Example”jobs: a: runs-on: ubuntu-latest b: permissions: read-all...Configuration
Section titled “Configuration”github-actions: lint: rules: missing-permissions: warn # off (default), warn, errorSuppress one line with sudsy-disable-next-line missing-permissions in a comment of the file’s language.