Skip to content

Conversation

@Kataglyphis
Copy link
Owner

No description provided.

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 23 days ago

To fix the problem, explicitly set the least privileges required for the GITHUB_TOKEN used in this workflow by adding a permissions block. The recommended way is to place the permissions at the root of the workflow (as a sibling of name and on), which sets permissions globally for all jobs that do not have their own permissions block. Since no details about the actions or steps inside the reused workflow are provided, the minimal starting point is to restrict permissions to contents: read, which is sufficient for basic read operations and does not grant write access. If later steps do need elevated permissions (like pull-requests: write), these can be added or further specified per-job. For now, add the block at line 2, after the workflow name, and before on:.

No imports, new methods, or other code changes are required—just this one addition to the YAML file.


Suggested changeset 1
.github/workflows/Linux_arm.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/Linux_arm.yml b/.github/workflows/Linux_arm.yml
--- a/.github/workflows/Linux_arm.yml
+++ b/.github/workflows/Linux_arm.yml
@@ -1,4 +1,6 @@
 name: Linux build + test + coverage on Ubuntu 24.04 ARM
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: Linux build + test + coverage on Ubuntu 24.04 ARM
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 23 days ago

How to, in general terms, fix the problem:
Explicitly set workflow (or job-level) permissions using the permissions key to limit the GITHUB_TOKEN to the smallest privilege necessary. For typical build/test workflows, contents: read is usually sufficient.

Detailed steps for this workflow:

  • Add a permissions: block at the top level of .github/workflows/Windows.yml (below name: and before on:) to set the workflow token permissions.
  • Set contents: read as a minimal, secure starting point.
  • If in the future jobs require greater permissions, further keys (e.g., pull-requests: write) could be selectively added per job as needed.

Files/regions/lines to change:

  • Insert a permissions: block between lines 1 and 3 in .github/workflows/Windows.yml.

What is needed (methods, imports, definitions) to implement the change:

  • No new imports or code methods needed; just YAML edit.

Suggested changeset 1
.github/workflows/Windows.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml
--- a/.github/workflows/Windows.yml
+++ b/.github/workflows/Windows.yml
@@ -1,5 +1,8 @@
 name: Windows Server 2025 build x86 MSVC and Clang
 
+permissions:
+  contents: read
+
 on:
   push:
     branches: [main, develop]
EOF
@@ -1,5 +1,8 @@
name: Windows Server 2025 build x86 MSVC and Clang

permissions:
contents: read

on:
push:
branches: [main, develop]
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@Kataglyphis Kataglyphis merged commit 6a12e7a into main Nov 14, 2025
17 checks passed
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