Skip to content

Potential fix for code scanning alert no. 15: Workflow does not contain permissions#1638

Merged
EvenSol merged 2 commits intomasterfrom
alert-autofix-15
Nov 4, 2025
Merged

Potential fix for code scanning alert no. 15: Workflow does not contain permissions#1638
EvenSol merged 2 commits intomasterfrom
alert-autofix-15

Conversation

@asmfstatoil
Copy link
Copy Markdown
Collaborator

Potential fix for https://github.com/equinor/neqsim/security/code-scanning/15

To fix the problem, you should explicitly set the minimal permissions that the workflow requires. The safest default is contents: read, which allows the workflow to read repository contents but not modify them, create releases, or write to issues/pull-requests. This fits the example and matches least-privilege principles. If in future the workflow needs broader permissions, you can expand them as needed. You should add the permissions: contents: read block at the root level (just after name: and before/after on: or above jobs:) of .github/workflows/maven_publish.yml.


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

@asmfstatoil asmfstatoil marked this pull request as ready for review November 3, 2025 14:47
@asmfstatoil asmfstatoil requested a review from EvenSol as a code owner November 3, 2025 14:47
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.27%. Comparing base (a0bc1f4) to head (08c51c2).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1638   +/-   ##
=========================================
  Coverage     47.27%   47.27%           
- Complexity     9192     9193    +1     
=========================================
  Files           886      886           
  Lines         87107    87107           
  Branches      11013    11013           
=========================================
+ Hits          41176    41182    +6     
+ Misses        42814    42808    -6     
  Partials       3117     3117           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@EvenSol EvenSol merged commit 70a2e4a into master Nov 4, 2025
12 checks passed
@EvenSol EvenSol deleted the alert-autofix-15 branch November 4, 2025 08:34
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.

3 participants