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
22 changes: 22 additions & 0 deletions .github/workflows/trigger_dune_upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Trigger Dune Revenue Upload

on:
push:
branches:
- biweekly-runs
paths:
- "fee_allocator/summaries/*.json"

permissions: {}

jobs:
dispatch:
runs-on: ubuntu-latest

steps:
- name: Trigger dune revenue upload
run: |
gh api repos/${{ secrets.DUNE_UPLOAD_REPO }}/dispatches \
-f event_type=recon-updated
env:
GH_TOKEN: ${{ secrets.DUNE_UPLOAD_TOKEN }}
Comment on lines +14 to +22

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

In general, the fix is to add an explicit permissions block to the workflow or to individual jobs, restricting the GITHUB_TOKEN to the minimum required scopes. This prevents the job from inheriting broad default permissions and documents the intended access level.

For this specific workflow, the dispatch job only invokes gh api using a separate GH_TOKEN from secrets.DUNE_UPLOAD_TOKEN and does not reference GITHUB_TOKEN. The minimal, non-breaking change is to add a job-level permissions block under jobs.dispatch that limits GITHUB_TOKEN to read-only repository contents. A safe common baseline is:

permissions:
  contents: read

This should be inserted directly under jobs.dispatch: (around current line 12) and indented to align with runs-on:. No additional imports or methods are needed, since this is purely a workflow configuration change.

Suggested changeset 1
.github/workflows/trigger_dune_upload.yaml

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/trigger_dune_upload.yaml b/.github/workflows/trigger_dune_upload.yaml
--- a/.github/workflows/trigger_dune_upload.yaml
+++ b/.github/workflows/trigger_dune_upload.yaml
@@ -9,6 +9,8 @@
 
 jobs:
   dispatch:
+    permissions:
+      contents: read
     runs-on: ubuntu-latest
 
     steps:
EOF
@@ -9,6 +9,8 @@

jobs:
dispatch:
permissions:
contents: read
runs-on: ubuntu-latest

steps:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just add read perms?