Skip to content

Potential fix for code scanning alert no. 4: Workflow does not contain permissions#18

Closed
Cadons wants to merge 1 commit into
mainfrom
alert-autofix-4
Closed

Potential fix for code scanning alert no. 4: Workflow does not contain permissions#18
Cadons wants to merge 1 commit into
mainfrom
alert-autofix-4

Conversation

@Cadons
Copy link
Copy Markdown
Owner

@Cadons Cadons commented May 6, 2026

Potential fix for https://github.com/Cadons/Docraft/security/code-scanning/4

Add an explicit workflow-level permissions block near the top of .github/workflows/build.yml (after on: and before jobs: is typical) to enforce least privilege for all jobs unless overridden.
For this workflow, the minimal safe baseline is:

  • contents: read (needed by actions/checkout)
  • actions: read (safe explicit read scope for action metadata)
  • checks: read (optional but harmless read-only)

Do not grant write scopes unless required (none are evident in the snippet). This preserves current behavior while ensuring token permissions remain restricted even if repo/org defaults 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>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@Cadons Cadons closed this May 6, 2026
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