Skip to content

Potential fix for code scanning alert no. 4: Workflow does not contain permissions#21

Merged
nstarman merged 1 commit intomainfrom
alert-autofix-4
Oct 1, 2025
Merged

Potential fix for code scanning alert no. 4: Workflow does not contain permissions#21
nstarman merged 1 commit intomainfrom
alert-autofix-4

Conversation

@nstarman
Copy link
Contributor

@nstarman nstarman commented Oct 1, 2025

Potential fix for https://github.com/GalacticDynamics/plotting_backends/security/code-scanning/4

In general terms:
Set the permissions for the dist job as limited as possible, ideally to contents: read, unless there is evidence that more is needed.

Detailed fix:
Add a permissions: block under the dist job, just like the test-publish and publish jobs already have. The minimal reasonable starting point is contents: read.

Where to change:
Edit .github/workflows/cd.yml, adding the following lines directly under line 25 (that is, after runs-on: ubuntu-latest in the dist job):

permissions:
  contents: read

What is needed:
No imports or external dependencies are required, just a YAML edit.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
@nstarman nstarman added this to the v0.2.0 milestone Oct 1, 2025
@nstarman nstarman marked this pull request as ready for review October 1, 2025 16:58
@nstarman nstarman merged commit 77a4c57 into main Oct 1, 2025
15 checks passed
@nstarman nstarman deleted the alert-autofix-4 branch October 1, 2025 16:58
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

Comments