Skip to content

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#202

Open
Yostra wants to merge 1 commit intomainfrom
alert-autofix-1
Open

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#202
Yostra wants to merge 1 commit intomainfrom
alert-autofix-1

Conversation

@Yostra
Copy link
Copy Markdown
Collaborator

@Yostra Yostra commented Mar 30, 2026

Potential fix for https://github.com/stripe/sync-engine/security/code-scanning/1

In general, the fix is to add an explicit permissions block defining the least privileges the workflow needs. Since this workflow only checks out code and runs local commands, it can safely use contents: read (the minimal permission needed for actions/checkout@v5). No other GitHub API scopes (like pull-requests: write or issues: write) are needed.

The best minimal, non-functional-change fix here is:

  • Add a workflow-level permissions block near the top of .github/workflows/ci.yml (after name: or after on:).
  • Set contents: read so that both test and e2e-test jobs inherit read-only repository contents access, while keeping everything else at default “none”.

Concretely, in .github/workflows/ci.yml, insert:

permissions:
  contents: read

after the name: CI line (line 1). No imports or additional definitions are required since this is purely a YAML configuration change.

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>
@Yostra Yostra marked this pull request as ready for review March 30, 2026 19:43
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