Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions .github/workflows/call-contributor-issue-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Handle contributor comment on GitHub issue

on:
issue_comment:
types: [created]

jobs:
call-workflow:
uses: learningequality/.github/.github/workflows/contributor-issue-comment.yml@main
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}
Comment on lines +9 to +14

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

To fix this problem, you should add a permissions: key to the workflow file. This can be done at the top level (applies to all jobs), or specifically for the call-workflow job. Since this workflow only calls another workflow and does not require any write permissions itself, the safest minimal permissions are permissions: {} (no permissions), or at most permissions: contents: read if the called workflow requires it. If you know specifically what permissions are needed by the reusable workflow, you can set them accordingly. For a minimal, least-privilege fix, insert the following at the top level, after the name: declaration and before on::

permissions:
  contents: read

If you know more specific permission requirements, you can adjust, but contents: read is generally sufficient for most workflows that do not modify code or use write APIs.


Suggested changeset 1
.github/workflows/call-contributor-issue-comment.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/call-contributor-issue-comment.yml b/.github/workflows/call-contributor-issue-comment.yml
--- a/.github/workflows/call-contributor-issue-comment.yml
+++ b/.github/workflows/call-contributor-issue-comment.yml
@@ -1,3 +1,5 @@
+permissions:
+  contents: read
 name: Handle contributor comment on GitHub issue
 
 on:
EOF
@@ -1,3 +1,5 @@
permissions:
contents: read
name: Handle contributor comment on GitHub issue

on:
Copilot is powered by AI and may make mistakes. Always verify output.
11 changes: 0 additions & 11 deletions .github/workflows/notify_team_new_comment.yml

This file was deleted.