Skip to content
Open
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@main
uses: reqstool/.github/.github/workflows/check-semantic-pr.yml@33502e31f66fb7e982f48f50e3c6c29b0410a017 # 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 1 day ago

In general, the fix is to explicitly set GitHub Actions permissions for the GITHUB_TOKEN at the least level required. Since this workflow only triggers on pull request events and delegates its work to a reusable workflow, a safe minimal starting point is to set contents: read at the workflow root level, which restricts the token while still allowing typical read operations needed for checks. If the reusable workflow needs broader permissions, those can be added later; starting with read-only is aligned with the recommendation you provided.

Concretely, in .github/workflows/check-semantic-pr.yml, add a top-level permissions: block between the on: block and the jobs: block. This block will then apply to all jobs that do not specify their own permissions, including jobs.check. No imports or extra definitions are needed, as this is purely a YAML configuration change. The rest of the workflow (the uses: reference to the reusable workflow and triggers) remains unchanged.

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
@@ -5,6 +5,9 @@
   pull_request_target:
     types: [opened, edited, synchronize, reopened]
 
+permissions:
+  contents: read
+
 jobs:
   check:
     uses: reqstool/.github/.github/workflows/check-semantic-pr.yml@33502e31f66fb7e982f48f50e3c6c29b0410a017 # main 2026-03-07
EOF
@@ -5,6 +5,9 @@
pull_request_target:
types: [opened, edited, synchronize, reopened]

permissions:
contents: read

jobs:
check:
uses: reqstool/.github/.github/workflows/check-semantic-pr.yml@33502e31f66fb7e982f48f50e3c6c29b0410a017 # main 2026-03-07
Copilot is powered by AI and may make mistakes. Always verify output.