Skip to content

Commit c89f259

Browse files
committed
reduce permissions scope for all github workflows
1 parent 80f7eeb commit c89f259

6 files changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/automatic-release.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@ on:
1313
# Allows you to run this workflow manually from the Actions tab
1414
# workflow_dispatch:
1515

16+
# Deny all GITHUB_TOKEN scopes by default; jobs opt into the minimum they need.
17+
permissions: {}
18+
1619
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1720
jobs:
1821
# This workflow contains a single job called "build"
1922
get-labels:
2023
if: ${{github.event.pull_request.merged == true && !startsWith(github.head_ref, 'release/')}}
2124
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
2227
outputs:
2328
labels: ${{ steps.match-label.outputs.match }}
2429
steps:

.github/workflows/build-and-validate.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
1111
cancel-in-progress: true
1212

13+
# Deny all GITHUB_TOKEN scopes by default; jobs opt into the minimum they need.
14+
permissions: {}
15+
1316
env:
1417
REGISTRY: ghcr.io
1518

.github/workflows/build-full-matrix.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
schedule:
1818
- cron: "21 8 * * 1"
1919

20+
# Deny all GITHUB_TOKEN scopes by default; jobs opt into the minimum they need.
21+
permissions: {}
22+
2023
env:
2124
REGISTRY: ghcr.io
2225

.github/workflows/build-python-base.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
- main
1616
- development
1717

18+
# Deny all GITHUB_TOKEN scopes by default; jobs opt into the minimum they need.
19+
permissions: {}
20+
1821
env:
1922
REGISTRY: ghcr.io
2023

.github/workflows/pr-labels.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ on:
88
branches: [ main ]
99
types: [ opened, labeled, unlabeled, synchronize ]
1010

11+
permissions: {}
12+
1113
jobs:
1214
contains-labels:
1315
if: ${{!startsWith(github.head_ref, 'release/')}}
1416
runs-on: ubuntu-latest
17+
permissions:
18+
pull-requests: read
1519
steps:
1620
- uses: jesusvasquez333/verify-pr-label-action@v1.4.0
1721
with:

.github/workflows/release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
required: true
1414
type: string
1515

16+
# Deny all GITHUB_TOKEN scopes by default; jobs opt into the minimum they need.
17+
permissions: {}
18+
1619
env:
1720
REGISTRY: ghcr.io
1821

0 commit comments

Comments
 (0)