Browse Source

fix: define top level permissions and fix token scope (#4543)

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Gergely Brautigam 1 year ago
parent
commit
c5fe1f6054
2 changed files with 10 additions and 11 deletions
  1. 6 8
      .github/workflows/codeql.yml
  2. 4 3
      .github/workflows/e2e.yml

+ 6 - 8
.github/workflows/codeql.yml

@@ -6,6 +6,12 @@ on:
   pull_request:
   pull_request:
     branches: [ "main" ]
     branches: [ "main" ]
 
 
+permissions:
+  contents: read
+  packages: read
+  actions: read
+  security-events: read
+
 jobs:
 jobs:
   analyze:
   analyze:
     name: Analyze project
     name: Analyze project
@@ -13,14 +19,6 @@ jobs:
     permissions:
     permissions:
       # required for all workflows
       # required for all workflows
       security-events: write
       security-events: write
-
-      # required to fetch internal or private CodeQL packs
-      packages: read
-
-      # only required for workflows in private repositories
-      actions: read
-      contents: read
-
     strategy:
     strategy:
       fail-fast: false
       fail-fast: false
     steps:
     steps:

+ 4 - 3
.github/workflows/e2e.yml

@@ -6,9 +6,9 @@ on:
 
 
 permissions:
 permissions:
   contents: read
   contents: read
-  issues: write
-  pull-requests: write
-  checks: write
+  issues: read
+  pull-requests: read
+  checks: read
   statuses: read
   statuses: read
 name: e2e tests
 name: e2e tests
 
 
@@ -85,6 +85,7 @@ jobs:
       id-token: write
       id-token: write
       checks: write
       checks: write
       contents: read
       contents: read
+      pull-requests: write
     if: github.event_name == 'repository_dispatch'
     if: github.event_name == 'repository_dispatch'
     steps:
     steps: