Skip to content

Commit c36d6ca

Browse files
authored
Merge pull request crossplane#5891 from harshitasao/scorecard-checks-fix
fix: fixed the token-permission and pinned-dependencies
2 parents 955c467 + f7f37f9 commit c36d6ca

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

.github/workflows/backport.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
types: [closed]
1111
# See also commands.yml for the /backport triggered variant of this workflow.
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
# NOTE(negz): I tested many backport GitHub actions before landing on this
1518
# one. Many do not support merge commits, or do not support pull requests with
@@ -18,6 +21,9 @@ jobs:
1821
# The main gotchas with this action are that it _only_ supports merge commits,
1922
# and that PRs _must_ be labelled before they're merged to trigger a backport.
2023
open-pr:
24+
permissions:
25+
contents: write # for zeebe-io/backport-action to create branch
26+
pull-requests: write # for zeebe-io/backport-action to create PR to backport
2127
runs-on: ubuntu-22.04
2228
if: github.event.pull_request.merged
2329
steps:

.github/workflows/ci.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
3333

3434
- name: Setup Earthly
35-
uses: earthly/actions-setup@v1
35+
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
3636
with:
3737
github-token: ${{ secrets.GITHUB_TOKEN }}
3838
version: ${{ env.EARTHLY_VERSION }}
@@ -78,7 +78,7 @@ jobs:
7878
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
7979

8080
- name: Setup Earthly
81-
uses: earthly/actions-setup@v1
81+
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
8282
with:
8383
github-token: ${{ secrets.GITHUB_TOKEN }}
8484
version: ${{ env.EARTHLY_VERSION }}
@@ -114,7 +114,7 @@ jobs:
114114
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
115115

116116
- name: Setup Earthly
117-
uses: earthly/actions-setup@v1
117+
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
118118
with:
119119
github-token: ${{ secrets.GITHUB_TOKEN }}
120120
version: ${{ env.EARTHLY_VERSION }}
@@ -149,6 +149,9 @@ jobs:
149149

150150

151151
trivy-scan-fs:
152+
permissions:
153+
contents: read # for actions/checkout to fetch code
154+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
152155
runs-on: ubuntu-22.04
153156
steps:
154157
- name: Checkout
@@ -178,7 +181,7 @@ jobs:
178181
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
179182

180183
- name: Setup Earthly
181-
uses: earthly/actions-setup@v1
184+
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
182185
with:
183186
github-token: ${{ secrets.GITHUB_TOKEN }}
184187
version: ${{ env.EARTHLY_VERSION }}
@@ -231,7 +234,7 @@ jobs:
231234
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
232235

233236
- name: Setup Earthly
234-
uses: earthly/actions-setup@v1
237+
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
235238
with:
236239
github-token: ${{ secrets.GITHUB_TOKEN }}
237240
version: ${{ env.EARTHLY_VERSION }}
@@ -319,7 +322,7 @@ jobs:
319322
fetch-depth: 0
320323

321324
- name: Setup Earthly
322-
uses: earthly/actions-setup@v1
325+
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
323326
with:
324327
github-token: ${{ secrets.GITHUB_TOKEN }}
325328
version: ${{ env.EARTHLY_VERSION }}
@@ -390,13 +393,13 @@ jobs:
390393
# seems to build Crossplane inside of a Docker image.
391394
- name: Build Fuzzers
392395
id: build
393-
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
396+
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@a2d113bc6b45af6135bc4bdb30916bb7c0aae07b # master
394397
with:
395398
oss-fuzz-project-name: "crossplane"
396399
language: go
397400

398401
- name: Run Fuzzers
399-
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
402+
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@a2d113bc6b45af6135bc4bdb30916bb7c0aae07b # master
400403
with:
401404
oss-fuzz-project-name: "crossplane"
402405
fuzz-seconds: 300
@@ -417,12 +420,12 @@ jobs:
417420
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
418421

419422
- name: Setup Buf
420-
uses: bufbuild/buf-setup-action@v1
423+
uses: bufbuild/buf-setup-action@76ddbd1bcb9da6da11cb7c41bd97e47f81c39a39 # v1.37.0
421424
with:
422425
github_token: ${{ secrets.GITHUB_TOKEN }}
423426

424427
- name: Lint Protocol Buffers
425-
uses: bufbuild/buf-lint-action@v1
428+
uses: bufbuild/buf-lint-action@06f9dd823d873146471cfaaf108a993fe00e5325 # v1.1.1
426429
with:
427430
input: apis
428431

@@ -438,7 +441,7 @@ jobs:
438441

439442
- name: Push Protocol Buffers to Buf Schema Registry
440443
if: ${{ github.repository == 'crossplane/crossplane' && github.ref == 'refs/heads/main' }}
441-
uses: bufbuild/buf-push-action@v1
444+
uses: bufbuild/buf-push-action@a654ff18effe4641ebea4a4ce242c49800728459 # v1.2.0
442445
with:
443446
input: apis
444447
buf_token: ${{ secrets.BUF_TOKEN }}

.github/workflows/promote.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
3939

4040
- name: Setup Earthly
41-
uses: earthly/actions-setup@v1
41+
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
4242
with:
4343
github-token: ${{ secrets.GITHUB_TOKEN }}
4444
version: ${{ env.EARTHLY_VERSION }}

.github/workflows/scan.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
env:
99
DOCKER_USR: ${{ secrets.DOCKER_USR }}
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
generate-matrix:
1316
runs-on: ubuntu-latest
@@ -78,6 +81,8 @@ jobs:
7881
echo $supported_releases | jq .
7982
8083
scan:
84+
permissions:
85+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
8186
needs:
8287
- check-matrix
8388
- generate-matrix

0 commit comments

Comments
 (0)