Skip to content

Potential fix for code scanning alert no. 8: Workflow does not contain permissions#578

Merged
Slashgear merged 1 commit intomasterfrom
alert-autofix-8
Feb 7, 2026
Merged

Potential fix for code scanning alert no. 8: Workflow does not contain permissions#578
Slashgear merged 1 commit intomasterfrom
alert-autofix-8

Conversation

@Slashgear
Copy link
Member

Potential fix for https://github.com/lyonjs/lyonjs.github.com/security/code-scanning/8

In general, the fix is to explicitly declare a permissions block that grants only the minimal required scopes for the GITHUB_TOKEN, either at the workflow root or per job. Since only the docker job needs packages: write and already declares its own permissions, the safest approach is to define a read-only default at the workflow level (contents: read), which will apply to format, nextjs, deploy-production, and deploy-preview, while leaving the docker job’s explicit permissions intact.

Concretely, in .github/workflows/integration.yml, add a top-level permissions: block right after the name: line (before on:). Set it to contents: read (and optionally packages: read if you want symmetry with the example, but it’s not necessary unless used). Because job-level permissions override workflow-level ones, the existing permissions block in the docker job will continue to grant packages: write only where needed. No imports or additional methods are required; this is a pure 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>
@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lyonjs-website Ready Ready Preview, Comment Feb 4, 2026 9:28pm

Request Review

@Slashgear Slashgear marked this pull request as ready for review February 4, 2026 21:27
@Slashgear Slashgear enabled auto-merge (squash) February 4, 2026 21:45
@Slashgear Slashgear merged commit 005b7af into master Feb 7, 2026
11 checks passed
@Slashgear Slashgear deleted the alert-autofix-8 branch February 7, 2026 17:20
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