Skip to content

Commit 23489b9

Browse files
Add back required permissions to GitHub actions workflows (#1184)
* Add required permissions to CodeQL workflow See: https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/running-codeql-code-scanning-in-a-container#example-workflow Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com> * also update publish workflows (require access to write to container registry) Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com> * move permissions to release job Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com> * remove contents: read permission (not required for public repos) Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com> * fix ubuntu version in publish-test-utils-image workflow Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com> --------- Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
1 parent 77a33f4 commit 23489b9

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

.github/workflows/continuous-integration.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
security:
4646
name: Security
4747
runs-on: ubuntu-22.04
48+
permissions:
49+
actions: read
50+
security-events: write # write CodeQL alerts
4851
steps:
4952
- name: Checkout
5053
uses: actions/checkout@v4

.github/workflows/publish-images.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: "Publish operator"
22

3-
permissions: {}
3+
permissions:
4+
packages: write # push container image
45

56
on:
67
push:

.github/workflows/publish-test-utils-image.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ concurrency:
1717
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1818
cancel-in-progress: true
1919

20-
permissions: {}
20+
permissions:
21+
packages: write # push container image
2122

2223
jobs:
2324
test-utils:
24-
runs-on: ubuntu-20.04
25+
runs-on: ubuntu-22.04
2526

2627
steps:
2728
- name: Checkout

.github/workflows/release.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
publish-images:
5151
needs: release
5252
uses: ./.github/workflows/reusable-publish-images.yaml
53+
permissions:
54+
packages: write # push container image
5355
with:
5456
publish_bundle: true
5557
version_tag: v${{ needs.release.outputs.operator_version }}

0 commit comments

Comments
 (0)