Skip to content

Potential fix for code scanning alert no. 11: Workflow does not contain permissions#369

Draft
zeel-codder wants to merge 1 commit intodevelopfrom
alert-autofix-11
Draft

Potential fix for code scanning alert no. 11: Workflow does not contain permissions#369
zeel-codder wants to merge 1 commit intodevelopfrom
alert-autofix-11

Conversation

@zeel-codder
Copy link
Collaborator

Potential fix for https://github.com/rtCamp/Frappe-Manager/security/code-scanning/11

In general, the problem is fixed by explicitly declaring a minimal permissions block so the GITHUB_TOKEN has only the scopes required. For a test workflow like this that only needs to read the repository contents and interact with caches and artifacts, contents: read is sufficient; no write permissions are required.

The best way to fix this without changing behavior is to add a root-level permissions block to .github/workflows/e2e-site.yaml so it applies to all jobs (check-permissions and e2e-current). Place it near the top of the file, after name: and before on:. Set permissions: contents: read, which allows actions/checkout and the other actions to work, while preventing unnecessary write access to repository contents or other resources. No additional methods, imports, or definitions are needed since this is a YAML configuration change only.

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>
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