Skip to content

Commit 0c684ab

Browse files
TehsmashSam Betts
authored andcommitted
Add granular permissions to GitHub action workflows
This commit adds granular permissions to the workflows that need them to perform their tasks. The release action needs access to the "contents" of a repo in order to create a release, and reusable-build-and-push requires access to packages in order to publish the containers.
1 parent c56f59c commit 0c684ab

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.github/workflows/main-merge.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches:
55
- main
66

7+
permissions:
8+
packages: write
9+
710
jobs:
811
build_and_push:
912
uses: ./.github/workflows/reusable-build-and-push.yml

.github/workflows/release.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
tags:
55
- "v[0-9]+.[0-9]+.[0-9]+"
66

7+
permissions:
8+
packages: write
9+
contents: write
10+
711
jobs:
812
build_and_push:
913
name: Build & Push

0 commit comments

Comments
 (0)