Skip to content

Conversation

@qdequippe
Copy link
Member

Potential fix for https://github.com/qdequippe-tech/pappers-php-api/security/code-scanning/6

In general, the fix is to explicitly set GitHub Actions permissions to the minimal required level instead of inheriting repository defaults. This can be done either at the workflow root (affecting all jobs) or per job. Here, there is a single job (check-cs) that only reads code, so we can safely restrict contents to read-only.

The best minimal fix without changing behavior is to add a permissions block at the workflow root, right after the on: block and before jobs:. We will set contents: read, which is sufficient for actions/checkout to fetch the repository content. No other scopes (like pull-requests or issues) are needed because the workflow does not interact with those APIs. Concretely, in .github/workflows/ci.yml, we’ll insert:

permissions:
    contents: read

aligned with the existing indentation so that it applies to all jobs in the workflow. No imports or additional methods 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>
@qdequippe qdequippe marked this pull request as ready for review January 2, 2026 12:22
@qdequippe qdequippe merged commit 1fed0ae into main Jan 2, 2026
3 checks passed
@qdequippe qdequippe deleted the alert-autofix-6 branch January 2, 2026 12:22
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