Skip to content

Conversation

@Coobaha
Copy link
Collaborator

@Coobaha Coobaha commented Dec 17, 2025

Potential fix for https://github.com/framer/server-api-examples/security/code-scanning/2

To fix the problem, add an explicit permissions block to restrict the GITHUB_TOKEN to only those permissions needed. The best way to implement least privilege, and future-proof the workflow, is to set this at the workflow root, which will then apply to all jobs unless a job-level permissions is provided. For the jobs in this workflow (linting, typechecking), only contents: read is required, as the jobs merely check out code and do not need to write to issues, PRs, etc.

Therefore, insert the following at the top level of .github/workflows/pull_request.yml (after the name: or immediately below the on: block):

permissions:
  contents: read

This change should be made after the name and before the on block (or immediately after on: if you prefer grouping triggers together). Preferably, it is conventional to place it after name and before on.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Coobaha and others added 2 commits December 17, 2025 15:49
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@Coobaha Coobaha marked this pull request as ready for review December 17, 2025 13:52
@Coobaha Coobaha requested a review from elmarburke December 17, 2025 13:53
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Comment @cursor review or bugbot run to trigger another review on this PR

@Coobaha Coobaha merged commit a09cc64 into main Dec 17, 2025
5 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.

3 participants