Skip to content

Commit

Permalink
build(ci): specify top level permissions for github workflows (#3022)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairyhum authored Aug 9, 2024
1 parent b0e1b5d commit b288f38
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build_docker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Build docker image
permissions:
contents: read

on:
workflow_call:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/build_example_images.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Build integration app example images
permissions:
contents: read

on:
workflow_dispatch:
Expand Down Expand Up @@ -28,6 +30,7 @@ jobs:
build_cassandra:
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_docker.yaml
with:
image_file: docker/cassandra/Dockerfile
Expand All @@ -43,6 +46,7 @@ jobs:
build_mysql_sidecar:
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_docker.yaml
with:
image_file: docker/kanister-mysql/image/Dockerfile
Expand All @@ -58,6 +62,7 @@ jobs:
build_kafka-adobe-s3-sink-connector:
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_docker.yaml
with:
image_file: docker/kafka-adobes3Connector/image/adobeSink.Dockerfile
Expand All @@ -73,6 +78,7 @@ jobs:
build_kafka-adobe-s3-source-connector:
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_docker.yaml
with:
image_file: docker/kafka-adobes3Connector/image/adobeSource.Dockerfile
Expand All @@ -88,6 +94,7 @@ jobs:
build_postgres-kanister-tools:
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_docker.yaml
with:
image_file: docker/postgres-kanister-tools/Dockerfile
Expand All @@ -103,6 +110,7 @@ jobs:
build_postgresql:
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_docker.yaml
with:
image_file: docker/postgresql/Dockerfile
Expand All @@ -118,6 +126,7 @@ jobs:
build_mongodb:
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_docker.yaml
with:
image_file: docker/mongodb/Dockerfile
Expand All @@ -134,6 +143,7 @@ jobs:
build_es-sidecar:
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_docker.yaml
with:
image_file: docker/kanister-elasticsearch/image/Dockerfile
Expand All @@ -149,6 +159,7 @@ jobs:
build_mssql-tools:
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_docker.yaml
with:
image_file: docker/mssql-tools/Dockerfile
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ jobs:
needs: [release, image_tags]
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_example_images.yaml
with:
image_tag: v9.99.9-dev
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Pre release
permissions:
contents: read

on:
workflow_dispatch:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Release
permissions:
contents: read

on:
push:
Expand Down Expand Up @@ -186,6 +188,7 @@ jobs:
needs: [run_if, release_packages]
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_example_images.yaml
with:
image_tag: ${{ needs.run_if.outputs.release_tag }}
Expand Down

0 comments on commit b288f38

Please sign in to comment.