Skip to content

Commit

Permalink
fix: improve security posture of GitHub Actions with zizmor (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishb authored Jan 3, 2025
1 parent b81f5b2 commit 9a41ee9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/format-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint-markdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Ruby
# See https://github.com/ruby/setup-ruby#versioning
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/release-binary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ on:
- "version.txt"
workflow_dispatch:

permissions:
contents: write

jobs:

generateTag:

name: "Auto-generate Git tag whenever version.txt changes"
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write

steps:

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true

- name: Fetch git tags
run: git fetch --force --tags
Expand Down Expand Up @@ -55,21 +55,26 @@ jobs:
runs-on: ubuntu-latest
needs: generateTag
timeout-minutes: 15
permissions:
contents: write

steps:

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true

- name: Fetch git tags
run: git fetch --force --tags

- uses: actions/setup-go@v5
with:
go-version: stable
cache-dependency-path: src/wp2hugo/go.sum
# To prevent cache poisoning
# Ref: https://woodruffw.github.io/zizmor/audits/#cache-poisoning
cache: false

# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
Expand Down

0 comments on commit 9a41ee9

Please sign in to comment.