Skip to content

Commit

Permalink
[StepSecurity] ci: Harden GitHub Actions
Browse files Browse the repository at this point in the history
Signed-off-by: StepSecurity Bot <[email protected]>
  • Loading branch information
step-security-bot committed Dec 15, 2024
1 parent dd40161 commit e3dc388
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/auto-add-issues-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
issues:
types:
- opened
permissions:
contents: read

jobs:
track_issue:
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build_canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches: [ main ]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -40,7 +43,7 @@ jobs:

# https://github.com/sigstore/cosign-installer
- name: Install Cosign
uses: sigstore/cosign-installer@v3
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0

- name: Check Cosign install!
run: cosign version
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
tags: ["v[0-9].[0-9].[0-9]"]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -49,7 +52,7 @@ jobs:

# https://github.com/sigstore/cosign-installer
- name: Install Cosign
uses: sigstore/cosign-installer@v3
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0

- name: Check Cosign install!
run: cosign version
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
e2e_tests:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build_scaler:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/linkinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
linkinator:
runs-on: ubuntu-20.04
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
validate:
name: validate - ${{ matrix.name }}
Expand Down Expand Up @@ -67,13 +70,16 @@ jobs:
run: ARCH=${{ matrix.name }} make test

statics:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
name: Static Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: "1.23"
- uses: golangci/golangci-lint-action@v6
- uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: v1.60

0 comments on commit e3dc388

Please sign in to comment.