Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-semantic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

jobs:
check:
uses: reqstool/.github/.github/workflows/check-semantic-pr.yml@33502e31f66fb7e982f48f50e3c6c29b0410a017 # main 2026-03-07
uses: reqstool/.github/.github/workflows/check-semantic-pr.yml@e1d67194373e4da7ccfdf400f46201f18ca14f23 # main 2026-03-07

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 4 days ago

In general, to fix this problem you explicitly declare a permissions block either at the root of the workflow (to apply to all jobs) or under the specific job that needs it. You grant only the minimal scopes required, commonly starting with contents: read and then adding more granular write scopes if needed. This ensures the GITHUB_TOKEN is not implicitly granted broad default permissions.

For this workflow, the safest, non‑breaking fix is to add a root‑level permissions block just below the name: line and before the on: key. Since we don’t see any steps here and the logic lives in the referenced reusable workflow, a minimal and safe default is contents: read, which is equivalent to a read‑only token for repository contents. If the reusable workflow requires more (for example, pull-requests: write), that can be added later in that workflow or by expanding this block, but adding contents: read now satisfies CodeQL and documents the intended least-privilege baseline without changing current behavior in most setups.

Concretely:

  • Edit .github/workflows/check-semantic-pr.yml.
  • Insert a permissions: mapping after line 1 (name: Check Semantic PR).
  • Set at least contents: read under permissions.

No extra imports or external libraries are needed.

Suggested changeset 1
.github/workflows/check-semantic-pr.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/check-semantic-pr.yml b/.github/workflows/check-semantic-pr.yml
--- a/.github/workflows/check-semantic-pr.yml
+++ b/.github/workflows/check-semantic-pr.yml
@@ -1,4 +1,6 @@
 name: Check Semantic PR
+permissions:
+  contents: read
 on:
   pull_request:
     types: [opened, edited, synchronize, reopened]
EOF
@@ -1,4 +1,6 @@
name: Check Semantic PR
permissions:
contents: read
on:
pull_request:
types: [opened, edited, synchronize, reopened]
Copilot is powered by AI and may make mistakes. Always verify output.
Loading