Skip to content

Commit aaf7c5c

Browse files
authored
Merge pull request #13771 from naveensrinivasan/naveen/feat/pin-actions
Pinned actions to SHA and included permissions for actions
2 parents 8f0e467 + 97d07cd commit aaf7c5c

15 files changed

+163
-93
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ on:
1313
env:
1414
GOPROXY: https://proxy.golang.org
1515
GO_VERSION: '1.17.7'
16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
build_minikube:
1821
runs-on: ubuntu-20.04
1922
steps:
20-
- uses: actions/checkout@v2
21-
- uses: actions/setup-go@v2
23+
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
24+
- uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2
2225
with:
2326
go-version: ${{env.GO_VERSION}}
2427
stable: true
@@ -37,15 +40,15 @@ jobs:
3740
echo workspace $GITHUB_WORKSPACE
3841
echo "end of debug stuff"
3942
echo $(which jq)
40-
- uses: actions/upload-artifact@v2
43+
- uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2
4144
with:
4245
name: minikube_binaries
4346
path: out
4447
lint:
4548
runs-on: ubuntu-20.04
4649
steps:
47-
- uses: actions/checkout@v2
48-
- uses: actions/setup-go@v2
50+
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
51+
- uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2
4952
with:
5053
go-version: ${{env.GO_VERSION}}
5154
stable: true
@@ -63,8 +66,8 @@ jobs:
6366
unit_test:
6467
runs-on: ubuntu-20.04
6568
steps:
66-
- uses: actions/checkout@v2
67-
- uses: actions/setup-go@v2
69+
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
70+
- uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2
6871
with:
6972
go-version: ${{env.GO_VERSION}}
7073
stable: true

.github/workflows/docs.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ on:
77
env:
88
GOPROXY: https://proxy.golang.org
99
GO_VERSION: '1.17.7'
10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
generate-docs:
1215
runs-on: ubuntu-20.04
1316
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-go@v2
17+
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
18+
- uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2
1619
with:
1720
go-version: ${{env.GO_VERSION}}
1821
stable: true
@@ -26,7 +29,7 @@ jobs:
2629
echo "::set-output name=changes::$c"
2730
- name: Create PR
2831
if: ${{ steps.gendocs.outputs.changes != '' }}
29-
uses: peter-evans/create-pull-request@v3
32+
uses: peter-evans/create-pull-request@18f7dc018cc2cd597073088f7c7591b9d1c02672 # v3
3033
with:
3134
token: ${{ secrets.MINIKUBE_BOT_PAT }}
3235
commit-message: Update auto-generated docs and translations

.github/workflows/functional_verified.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,18 @@ env:
2323
GOPROXY: https://proxy.golang.org
2424
GO_VERSION: '1.17.7'
2525

26+
permissions:
27+
contents: read
28+
2629
jobs:
2730
# Runs before all other jobs
2831
# builds the minikube binaries
2932
build_minikube:
3033
if: contains(github.event.pull_request.labels.*.name, 'ok-to-test')
3134
runs-on: ubuntu-20.04
3235
steps:
33-
- uses: actions/checkout@v2
34-
- uses: actions/setup-go@v2
36+
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
37+
- uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2
3538
with:
3639
go-version: ${{env.GO_VERSION}}
3740
stable: true
@@ -43,11 +46,13 @@ jobs:
4346
sudo apt-get install -y libvirt-dev
4447
MINIKUBE_BUILD_IN_DOCKER=y make cross e2e-cross debs
4548
cp -r test/integration/testdata ./out
46-
- uses: actions/upload-artifact@v2
49+
- uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2
4750
with:
4851
name: minikube_binaries
4952
path: out
5053
functional_docker_ubuntu_arm64:
54+
permissions:
55+
contents: none
5156
needs: [ build_minikube ]
5257
runs-on: [ self-hosted, arm64 ]
5358
env:
@@ -110,13 +115,13 @@ jobs:
110115
hostname || true
111116
echo "--------------------------"
112117
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
113-
- uses: actions/setup-go@v2
118+
- uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2
114119
with:
115120
go-version: ${{env.GO_VERSION}}
116121
stable: true
117122

118123
- name: Download Binaries
119-
uses: actions/download-artifact@v1
124+
uses: actions/download-artifact@fdafc3f9f2e2a522dc1d230e6a03de57a1e71c95 # v1
120125
with:
121126
name: minikube_binaries
122127

@@ -162,7 +167,7 @@ jobs:
162167
echo "${STAT}" >> $GITHUB_ENV
163168
echo 'EOF' >> $GITHUB_ENV
164169
165-
- uses: actions/upload-artifact@v2
170+
- uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2
166171
with:
167172
name: functional_docker_ubuntu_arm64
168173
path: minikube_binaries/report
@@ -190,21 +195,23 @@ jobs:
190195
# After all integration tests finished
191196
# collect all the reports and upload them
192197
upload_all_reports:
198+
permissions:
199+
contents: none
193200
needs:
194201
[
195202
functional_docker_ubuntu_arm64,
196203
]
197204
runs-on: ubuntu-20.04
198205
steps:
199206
- name: download all extra reports
200-
uses: actions/download-artifact@v2-preview
207+
uses: actions/download-artifact@9fde3de0b74bd6bc202952485c264b551a4f9405 # v2-preview
201208
- name: upload all extra reports
202209
shell: bash {0}
203210
continue-on-error: true
204211
run: |
205212
mkdir -p all_reports
206213
cp -r ./functional_docker_ubuntu_arm64 ./all_reports/
207-
- uses: actions/upload-artifact@v2
214+
- uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2
208215
with:
209216
name: all_reports
210217
path: all_reports

.github/workflows/leaderboard.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ on:
88
types: [published]
99
env:
1010
GO_VERSION: '1.17.7'
11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
update-leaderboard:
1316
runs-on: ubuntu-20.04
1417
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-go@v2
18+
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
19+
- uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2
1720
with:
1821
go-version: ${{env.GO_VERSION}}
1922
stable: true
@@ -29,7 +32,7 @@ jobs:
2932
GITHUB_TOKEN: ${{ secrets.MINIKUBE_BOT_PAT }}
3033
- name: Create PR
3134
if: ${{ steps.leaderboard.outputs.changes != '' }}
32-
uses: peter-evans/create-pull-request@v3
35+
uses: peter-evans/create-pull-request@18f7dc018cc2cd597073088f7c7591b9d1c02672 # v3
3336
with:
3437
token: ${{ secrets.MINIKUBE_BOT_PAT }}
3538
commit-message: Update leaderboard

0 commit comments

Comments
 (0)