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
16 changes: 16 additions & 0 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Add bugs to triage board

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/cloudflare/projects/47
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
Comment on lines +10 to +16

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

To fix the issue, explicitly define a permissions block for the add-to-project job, using the least privileges required for the task. Based on the functionality of the workflow (adding issues to a project), the following permissions are appropriate:

  • contents: read: Required for accessing repository content.
  • issues: write: Required for interacting with issues.

The permissions block should be added under the add-to-project job configuration in .github/workflows/triage.yml.

Suggested changeset 1
.github/workflows/triage.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/triage.yml b/.github/workflows/triage.yml
--- a/.github/workflows/triage.yml
+++ b/.github/workflows/triage.yml
@@ -9,6 +9,9 @@
   add-to-project:
     name: Add issue to project
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      issues: write
     steps:
       - uses: actions/add-to-project@v1.0.2
         with:
EOF
@@ -9,6 +9,9 @@
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- uses: actions/add-to-project@v1.0.2
with:
Copilot is powered by AI and may make mistakes. Always verify output.
Loading