Skip to content

Workflow does not contain permissions#3749

Merged
rhc54 merged 1 commit intoopenpmix:masterfrom
rhc54:topic/fix-code-scanning-alerts
Dec 25, 2025
Merged

Workflow does not contain permissions#3749
rhc54 merged 1 commit intoopenpmix:masterfrom
rhc54:topic/fix-code-scanning-alerts

Conversation

@rhc54
Copy link
Contributor

@rhc54 rhc54 commented Dec 25, 2025

Per Copilot:

To fix the problem, explicitly declare a permissions block so that the GITHUB_TOKEN is limited to the minimal rights required. Since this workflow only checks out code and builds/tests it, it only needs read access to repository contents; no job appears to require write permissions or access to other scopes (issues, pull requests, packages, etc.).

The most straightforward fix that doesn’t alter existing behavior is to add a single, workflow-wide permissions block at the top level (same indentation as on: and jobs:) and set contents: read. This applies to all jobs that don’t override permissions, covering macos, ubuntu, and distcheck in one place. Concretely, in .github/workflows/builds.yaml, insert:

permissions:
contents: read

between the on: [pull_request] line and the jobs: line. No additional imports, methods, or other changes are required.

Per Copilot:

To fix the problem, explicitly declare a permissions block so that the GITHUB_TOKEN is limited to the minimal rights required. Since this workflow only checks out code and builds/tests it, it only needs read access to repository contents; no job appears to require write permissions or access to other scopes (issues, pull requests, packages, etc.).

The most straightforward fix that doesn’t alter existing behavior is to add a single, workflow-wide permissions block at the top level (same indentation as on: and jobs:) and set contents: read. This applies to all jobs that don’t override permissions, covering macos, ubuntu, and distcheck in one place. Concretely, in .github/workflows/builds.yaml, insert:

permissions:
  contents: read

between the on: [pull_request] line and the jobs: line. No additional imports, methods, or other changes are required.

Signed-off-by: Ralph Castain <rhc@pmix.org>
@rhc54 rhc54 merged commit 77fc998 into openpmix:master Dec 25, 2025
26 checks passed
@rhc54 rhc54 deleted the topic/fix-code-scanning-alerts branch December 25, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant