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
9 changes: 9 additions & 0 deletions .github/workflows/assignment-helper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Assignment Helper

on:
issue_comment:
types: [created]

jobs:
assignment-helper:
uses: kubestellar/infra/.github/workflows/reusable-assignment-helper.yml@main

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 3 months ago

In general, the fix is to add an explicit permissions block that grants only the minimal GITHUB_TOKEN scopes required by this workflow. This can be done at the top level of the workflow (applies to all jobs) or under the specific job. Since this file contains a single job, either location is fine; adding it at the job level keeps the scope clear and local.

The best minimal, non-breaking fix here is to add permissions: { contents: read } to the assignment-helper job, since most reusable workflows at least need to read repository contents. We should not assume the need for write operations (like issues: write or pull-requests: write) without seeing evidence; if the reusable workflow requires more, it will fail and can then be adjusted. Concretely, in .github/workflows/assignment-helper.yml, under jobs:, and indented to align with uses:, insert:

    permissions:
      contents: read

No imports or additional methods are needed; this is purely a YAML configuration change within the GitHub Actions workflow.

Suggested changeset 1
.github/workflows/assignment-helper.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/assignment-helper.yml b/.github/workflows/assignment-helper.yml
--- a/.github/workflows/assignment-helper.yml
+++ b/.github/workflows/assignment-helper.yml
@@ -6,4 +6,6 @@
 
 jobs:
   assignment-helper:
+    permissions:
+      contents: read
     uses: kubestellar/infra/.github/workflows/reusable-assignment-helper.yml@main
EOF
@@ -6,4 +6,6 @@

jobs:
assignment-helper:
permissions:
contents: read
uses: kubestellar/infra/.github/workflows/reusable-assignment-helper.yml@main
Copilot is powered by AI and may make mistakes. Always verify output.