Skip to content

Potential fix for code scanning alert no. 11: Workflow does not contain permissions#580

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

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

Conversation

@Slashgear
Copy link
Member

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

To fix the problem, explicitly restrict GITHUB_TOKEN permissions in the workflow, granting only what is required. These jobs do not call the GitHub REST/GraphQL APIs or push to the repo; they only need to read workflow metadata (github.* context) and write to $GITHUB_STEP_SUMMARY, which works with contents: read. Therefore, we can safely set minimal read-only permissions for both jobs.

The best fix without changing existing behavior is to add a permissions block at the workflow root so it applies to all jobs. In .github/workflows/deploy-cleanup.yml, insert, after name: 🧹 Cleanup and before on:, a block like:

permissions:
  contents: read

This limits GITHUB_TOKEN to read-only repository contents, which is sufficient for accessing the workflow’s context and for using the step summary. No additional imports or code changes are needed; only the YAML workflow header is updated.

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>
@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:29pm

Request Review

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