Skip to content

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

Merged
tmokmss merged 1 commit intomainfrom
alert-autofix-2
Aug 21, 2025
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#82
tmokmss merged 1 commit intomainfrom
alert-autofix-2

Conversation

@tmokmss
Copy link
Copy Markdown
Contributor

@tmokmss tmokmss commented Aug 21, 2025

Potential fix for https://github.com/aws-samples/dify-self-hosted-on-aws/security/code-scanning/2

To fix the problem, explicitly set the permissions block in the workflow to restrict the GITHUB_TOKEN to the minimum required privileges. Since the workflow only checks out code and runs build/test commands, it only needs read access to repository contents. The best way to do this is to add permissions: contents: read at the top level of the workflow (just after the name key and before on:), so it applies to all jobs. No changes to the jobs or steps are required.


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>
@tmokmss tmokmss marked this pull request as ready for review August 21, 2025 08:07
@tmokmss tmokmss merged commit a4b7610 into main Aug 21, 2025
3 checks passed
@tmokmss tmokmss deleted the alert-autofix-2 branch August 21, 2025 08:07
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