Skip to content

Potential fix for code scanning alert no. 2: Workflow does not contain permissions - #2

Merged
rajatgl17 merged 1 commit into
mainfrom
alert-autofix-2
Aug 11, 2026
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#2
rajatgl17 merged 1 commit into
mainfrom
alert-autofix-2

Conversation

@rajatgl17

Copy link
Copy Markdown
Member

Potential fix for https://github.com/data-spec-labs/odcs-java-sdk/security/code-scanning/2

Add an explicit permissions block to .github/workflows/ci.yml at the workflow root (best single change), so all jobs inherit it unless overridden. For this workflow, a minimal safe baseline is:

  • contents: read

This preserves existing functionality (checkout + build/test + sonar invocation) while preventing unintended token write capabilities. No imports, methods, or additional definitions are needed—just YAML key insertion between on and jobs (or anywhere at top-level).

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>
@rajatgl17
rajatgl17 marked this pull request as ready for review August 11, 2026 09:56
@rajatgl17
rajatgl17 merged commit 5721ccb into main Aug 11, 2026
3 checks passed
@rajatgl17
rajatgl17 deleted the alert-autofix-2 branch August 11, 2026 09:57
@sonarqubecloud

Copy link
Copy Markdown

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