Skip to content

Potential fix for code scanning alert no. 19: Workflow does not contain permissions#899

Merged
inimaz merged 2 commits into
masterfrom
alert-autofix-19
Jul 12, 2025
Merged

Potential fix for code scanning alert no. 19: Workflow does not contain permissions#899
inimaz merged 2 commits into
masterfrom
alert-autofix-19

Conversation

@SaboniAmine

Copy link
Copy Markdown
Member

Potential fix for https://github.com/mlco2/codecarbon/security/code-scanning/19

To fix the issue, we will add an explicit permissions block to the workflow. Since this workflow mostly involves reading repository contents and performing tests, we will set the contents: read permission at the workflow level. This will apply to all jobs in the workflow. If any specific job later requires additional permissions, they can be specified individually for that job.

The changes will be made at the root of the workflow file (.github/workflows/test-package.yml) by adding a permissions block just below the workflow name.

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

…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@SaboniAmine SaboniAmine requested a review from benoit-cty July 12, 2025 14:44
@inimaz inimaz marked this pull request as ready for review July 12, 2025 15:02
@inimaz

inimaz commented Jul 12, 2025

Copy link
Copy Markdown
Collaborator

💯

@inimaz inimaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SaboniAmine !

@inimaz inimaz merged commit 005826d into master Jul 12, 2025
5 checks passed
@inimaz inimaz deleted the alert-autofix-19 branch July 12, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants