Skip to content

Commit 1e2a7a0

Browse files
authored
ci: add explicit permissions to GitHub Actions workflows (#42)
1 parent e2c7c54 commit 1e2a7a0

4 files changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ env:
1212
REGISTRY: ghcr.io
1313
IMAGE_NAME: ${{ github.repository_owner }}/postgres
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
build:
1720
runs-on: ubuntu-latest
@@ -72,6 +75,9 @@ jobs:
7275
test:
7376
needs: build
7477
runs-on: ubuntu-latest
78+
permissions:
79+
contents: read
80+
packages: read
7581
strategy:
7682
fail-fast: false # Don't cancel other tests if one fails
7783
matrix:

.github/workflows/helm.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ env:
2121
REGISTRY: ghcr.io
2222
HELM_REGISTRY: oci://ghcr.io/flanksource/charts
2323

24+
permissions:
25+
contents: read
26+
2427
jobs:
2528
lint-and-test:
2629
runs-on: ubuntu-latest
@@ -91,6 +94,9 @@ jobs:
9194
9295
security-scan:
9396
runs-on: ubuntu-latest
97+
permissions:
98+
contents: read
99+
security-events: write
94100
steps:
95101
- name: Checkout
96102
uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ env:
1717
REGISTRY: ghcr.io
1818
IMAGE_NAME: ${{ github.repository_owner }}/postgres
1919

20+
permissions:
21+
contents: read
22+
2023
jobs:
2124
determine-version:
2225
runs-on: ubuntu-latest

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ env:
1414
TEST_USER: testuser
1515
TEST_PASSWORD: testpass123
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
test-env-variables:
1922
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)