Skip to content

Commit

Permalink
chore: Improve action security
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Dec 31, 2024
1 parent bd4d0bb commit 9f29d5a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"extends": [
"config:recommended",
"group:allNonMajor",
"helpers:pinGitHubActionDigests",
"helpers:pinGitHubActionDigestsToSemver",
"security:openssf-scorecard",
":approveMajorUpdates",
":automergeStableNonMajor",
Expand Down Expand Up @@ -43,4 +43,4 @@
"versioningTemplate": "ruby"
}
]
}
}
20 changes: 20 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ on:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: ruby/setup-ruby@bfefad842bb982ff05b233bcbc1571d97a87e69f # v1.206.0
with:
Expand All @@ -37,12 +42,16 @@ jobs:
- '3.1'
- '3.2'
- '3.3'
- '3.4'
- truffleruby

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: ruby/setup-ruby@bfefad842bb982ff05b233bcbc1571d97a87e69f # v1.206.0
with:
ruby-version: ${{ matrix.ruby }}
Expand All @@ -66,11 +75,15 @@ jobs:
- '3.1'
- '3.2'
- '3.3'
- '3.4'

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: ruby/setup-ruby@bfefad842bb982ff05b233bcbc1571d97a87e69f # v1.206.0
with:
ruby-version: ${{ matrix.ruby }}
Expand All @@ -92,6 +105,7 @@ jobs:
- '3.1'
- '3.2'
- '3.3'
# - '3.4' # Not yet present
- mswin
- ucrt
include:
Expand All @@ -102,6 +116,9 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: ruby/setup-ruby@bfefad842bb982ff05b233bcbc1571d97a87e69f # v1.206.0
with:
ruby-version: ${{ matrix.ruby }}
Expand Down Expand Up @@ -130,6 +147,9 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: ruby/setup-ruby@bfefad842bb982ff05b233bcbc1571d97a87e69f # v1.206.0
with:
ruby-version: ${{ matrix.ruby }}
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: GitHub Actions Security Analysis with zizmor

on:
push:
branches: ["main"]
pull_request:

jobs:
zizmor:
name: zizmor latest via Cargo
runs-on: ubuntu-latest
permissions:
security-events: write
# required for workflows in private repositories
contents: read
actions: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1

- run: cargo install --locked zizmor
- run: zizmor --persona pedantic --format sarif . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
sarif_file: results.sarif
category: zizmor

0 comments on commit 9f29d5a

Please sign in to comment.