Skip to content

Commit 0ada2f6

Browse files
committed
harden git workflows
Signed-off-by: PrashantR30 <pramhit@mirantis.com>
1 parent fed0b2a commit 0ada2f6

11 files changed

Lines changed: 45 additions & 3 deletions

.github/workflows/code-scanning.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ jobs:
2323
runs-on: ubuntu-latest
2424
timeout-minutes: 360
2525
permissions:
26+
contents: read
2627
security-events: write
2728
packages: read
2829
steps:
2930
- name: Checkout repository
3031
uses: actions/checkout@v6
32+
with:
33+
persist-credentials: false
3134

3235
- name: Initialize CodeQL
3336
uses: github/codeql-action/init@v4

.github/workflows/config-checks.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@ on:
1818
workflow_call:
1919
workflow_dispatch:
2020

21+
permissions:
22+
contents: read
23+
2124
jobs:
2225
helm-lint:
2326
runs-on: ubuntu-latest
2427
timeout-minutes: 10
2528
steps:
2629
- name: Checkout code
2730
uses: actions/checkout@v6
31+
with:
32+
persist-credentials: false
2833
- name: Install Helm
2934
uses: azure/setup-helm@v5.0.0
3035
id: install
@@ -36,6 +41,8 @@ jobs:
3641
steps:
3742
- name: Checkout code
3843
uses: actions/checkout@v6
44+
with:
45+
persist-credentials: false
3946
- name: Get Golang version
4047
id: vars
4148
run: |
@@ -53,6 +60,8 @@ jobs:
5360
steps:
5461
- name: Checkout code
5562
uses: actions/checkout@v6
63+
with:
64+
persist-credentials: false
5665
- name: Get Golang version
5766
id: vars
5867
run: |

.github/workflows/coverage.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
steps:
3030
- name: Checkout code
3131
uses: actions/checkout@v6
32+
with:
33+
persist-credentials: false
3234
- name: Get Golang version
3335
id: vars
3436
run: |

.github/workflows/e2e-tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ jobs:
8282
steps:
8383
- uses: actions/checkout@v6
8484
name: Check out code
85+
with:
86+
persist-credentials: false
8587
- name: Download values override file
8688
if: ${{ inputs.use_values_override }}
8789
uses: actions/download-artifact@v8
@@ -148,6 +150,8 @@ jobs:
148150
steps:
149151
- uses: actions/checkout@v6
150152
name: Check out code
153+
with:
154+
persist-credentials: false
151155
- name: Download values override file
152156
if: ${{ inputs.use_values_override }}
153157
uses: actions/download-artifact@v8

.github/workflows/forward-compatibility.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
contents: read
3434
steps:
3535
- uses: actions/checkout@v6
36+
with:
37+
persist-credentials: false
3638

3739
- name: Install regctl
3840
uses: regclient/actions/regctl-installer@148669fe4b19151fcab6e00c6df2db43b9e2b097

.github/workflows/golang-checks.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@v6
3030
name: Checkout code
31+
with:
32+
persist-credentials: false
3133
- name: Get Golang version
3234
id: vars
3335
run: |
@@ -63,6 +65,8 @@ jobs:
6365
steps:
6466
- name: Checkout code
6567
uses: actions/checkout@v6
68+
with:
69+
persist-credentials: false
6670
- name: Get Golang version
6771
id: vars
6872
run: |
@@ -89,4 +93,6 @@ jobs:
8993
steps:
9094
- uses: actions/checkout@v6
9195
name: Checkout code
96+
with:
97+
persist-credentials: false
9298
- run: make docker-build

.github/workflows/image-builds.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ jobs:
8686
steps:
8787
- uses: actions/checkout@v6
8888
name: Check out code
89+
with:
90+
persist-credentials: false
8991
- name: Login to GitHub Container Registry
9092
uses: docker/login-action@v4
9193
with:
@@ -118,6 +120,8 @@ jobs:
118120
steps:
119121
- uses: actions/checkout@v6
120122
name: Check out code
123+
with:
124+
persist-credentials: false
121125
- name: Login to GitHub Container Registry
122126
uses: docker/login-action@v4
123127
with:
@@ -146,6 +150,8 @@ jobs:
146150
steps:
147151
- uses: actions/checkout@v6
148152
name: Check out code
153+
with:
154+
persist-credentials: false
149155
- name: Login to GitHub Container Registry
150156
uses: docker/login-action@v4
151157
with:
@@ -163,4 +169,3 @@ jobs:
163169
${OPERATOR_IMAGE_AMD} \
164170
${OPERATOR_IMAGE_ARM}
165171
docker manifest push ${OPERATOR_MULTIARCH_IMAGE}
166-

.github/workflows/publish-helm-oci-chart.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
steps:
4040
- uses: actions/checkout@v6
4141
name: Check out code
42+
with:
43+
persist-credentials: false
4244

4345
- name: Set up Helm
4446
uses: azure/setup-helm@v5.0.0

.github/workflows/release-image-list.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
name: Check out code
3535
with:
3636
ref: ${{ github.event.release.tag_name }}
37+
persist-credentials: false
3738
- name: Set up Python
3839
uses: actions/setup-python@v6
3940
with:
@@ -66,6 +67,8 @@ jobs:
6667
steps:
6768
- uses: actions/checkout@v6
6869
name: Check out code
70+
with:
71+
persist-credentials: false
6972
- name: Download image list artifact
7073
uses: actions/download-artifact@v8
7174
with:

.github/workflows/release.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ jobs:
6868
steps:
6969
- uses: actions/checkout@v6
7070
name: Check out code
71+
with:
72+
persist-credentials: false
7173
- name: Install regctl
7274
uses: regclient/actions/regctl-installer@148669fe4b19151fcab6e00c6df2db43b9e2b097
7375
with:
@@ -91,6 +93,8 @@ jobs:
9193
steps:
9294
- uses: actions/checkout@v6
9395
name: Check out code
96+
with:
97+
persist-credentials: false
9498
- name: Login to GitHub Container Registry
9599
uses: docker/login-action@v4
96100
with:

0 commit comments

Comments
 (0)