Skip to content

Commit

Permalink
[StepSecurity] ci: Harden GitHub Actions (chainguard-dev#390)
Browse files Browse the repository at this point in the history
Signed-off-by: StepSecurity Bot <[email protected]>
  • Loading branch information
step-security-bot authored Jul 30, 2024
1 parent 0242a06 commit 1167d83
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/go-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
branches:
- "main"

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -31,7 +34,7 @@ jobs:
go-version-file: go.mod
check-latest: true

- uses: chainguard-dev/actions/goimports@main
- uses: chainguard-dev/actions/goimports@9d943fc9889a0c0795e3c2bd4b949a9b610ac02e # main

- name: install libyara-dev
run: |
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ jobs:
name: check gofmt
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit

- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

Expand All @@ -26,14 +31,19 @@ jobs:
go-version-file: go.mod
check-latest: true

- uses: chainguard-dev/actions/gofmt@main
- uses: chainguard-dev/actions/gofmt@9d943fc9889a0c0795e3c2bd4b949a9b610ac02e # main
with:
args: -s

goimports:
name: check goimports
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit

- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

Expand All @@ -43,13 +53,18 @@ jobs:
go-version-file: go.mod
check-latest: true

- uses: chainguard-dev/actions/goimports@main
- uses: chainguard-dev/actions/goimports@9d943fc9889a0c0795e3c2bd4b949a9b610ac02e # main

golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Set up Go
Expand Down Expand Up @@ -78,6 +93,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit

- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

Expand Down

0 comments on commit 1167d83

Please sign in to comment.