Skip to content

Potential fix for code scanning alert no. 12: Workflow does not contain permissions#368

Closed
Xieyt wants to merge 1 commit intodevelopfrom
alert-autofix-12
Closed

Potential fix for code scanning alert no. 12: Workflow does not contain permissions#368
Xieyt wants to merge 1 commit intodevelopfrom
alert-autofix-12

Conversation

@Xieyt
Copy link
Copy Markdown
Collaborator

@Xieyt Xieyt commented Feb 20, 2026

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

In general, the fix is to explicitly declare a permissions block limiting the GITHUB_TOKEN to the minimal scopes needed, either at the workflow root (applies to all jobs) or per job. For this workflow, the jobs only need to read repository contents and use artifacts; they do not push or modify GitHub resources, so read-only contents (and default read for others) is sufficient.

The single best fix without changing functionality is to add a workflow-level permissions block just after the on: section, with contents: read. This will apply to both check-permissions and e2e-current since neither defines their own permissions, and it directly addresses the CodeQL warning on e2e-current (line 23) by constraining GITHUB_TOKEN. Concretely, edit .github/workflows/e2e-site.yaml to insert:

permissions:
  contents: read

between the on: block (lines 3–9) and the jobs: block (line 11). No additional imports or methods are needed because this is purely a YAML configuration change for GitHub Actions.

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>
@Xieyt Xieyt marked this pull request as ready for review February 20, 2026 07:18
Copilot AI review requested due to automatic review settings February 20, 2026 07:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses code scanning alert #12 by explicitly constraining the default GITHUB_TOKEN permissions in the E2E site GitHub Actions workflow.

Changes:

  • Add a workflow-level permissions block to limit contents access to read-only.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Xieyt Xieyt closed this Apr 14, 2026
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.

2 participants