Skip to content

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#20

Merged
K-1873 merged 1 commit into
mainfrom
feature/alert-autofix-2
May 21, 2026
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#20
K-1873 merged 1 commit into
mainfrom
feature/alert-autofix-2

Conversation

@K-1873

@K-1873 K-1873 commented May 21, 2026

Copy link
Copy Markdown
Contributor

Potential fix for https://github.com/AndanteTribe/ObjectReference/security/code-scanning/2

Add an explicit permissions block to the workflow YAML so the GITHUB_TOKEN is constrained to the minimum required scope.

Best fix (without changing behavior): set workflow-level permissions to read-only repository contents, since this workflow checks code/meta files and does not create issues, comments, releases, or push changes. This should be added near the top-level keys (after on or before jobs) in .github/workflows/unity-meta-file-check.yml:

  • permissions:
    • contents: read

This applies to all jobs in the workflow (including meta-check) unless overridden, and directly addresses the CodeQL alert.

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>
@K-1873 K-1873 marked this pull request as ready for review May 21, 2026 12:35
Copilot AI review requested due to automatic review settings May 21, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses GitHub code scanning alert #2 by explicitly constraining the default GITHUB_TOKEN permissions for the Unity meta file checking workflow to the minimum required scope.

Changes:

  • Adds a workflow-level permissions block to restrict token scope.
  • Sets contents: read to support repository checkout and file inspection without granting write access.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@K-1873 K-1873 merged commit f1fef15 into main May 21, 2026
8 checks passed
@K-1873 K-1873 deleted the feature/alert-autofix-2 branch May 21, 2026 12:37
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