Skip to content

Potential fix for code scanning alert no. 3: Workflow does not contain permissions#163

Merged
mikolayek merged 1 commit intomasterfrom
alert-autofix-3
Nov 10, 2025
Merged

Potential fix for code scanning alert no. 3: Workflow does not contain permissions#163
mikolayek merged 1 commit intomasterfrom
alert-autofix-3

Conversation

@mikolayek
Copy link
Copy Markdown
Member

Potential fix for https://github.com/SAP/hybris-commerce-eclipse-plugin/security/code-scanning/3

To fix this problem, you should add a permissions block to the affected job in your workflow, limiting the GITHUB_TOKEN to only those privileges required for the analysis. Neither the workflow nor the job currently declares any permissions: block. The best fix in this case is to add permissions: contents: read to the job (or at the workflow root) unless more write permissions are required for this specific workflow, which is not the case here. You should insert this block in the analyze job, right after the name: Analyze or before runs-on. Edit .github/workflows/codeql-analysis.yml, adding:

permissions:
  contents: read

just after

name: Analyze

No additional imports, methods, or definitions are needed.

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>
@mikolayek mikolayek marked this pull request as ready for review November 10, 2025 12:50
@github-actions
Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA cc8e8d4.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@sonarqubecloud
Copy link
Copy Markdown

@mikolayek mikolayek merged commit 6170814 into master Nov 10, 2025
9 of 11 checks passed
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