Skip to content

Commit

Permalink
Merge pull request #109 from maxmind/nobeid/github-actions-zizmor
Browse files Browse the repository at this point in the history
integrate zizmor in github actions
  • Loading branch information
ugexe authored Jan 10, 2025
2 parents 3a396da + dc5ddb0 commit c268133
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 5 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

# zizmor complains that 'v1' is a ref that can be provided by both the branch and tag namespaces.
# specify that we want the v1 branch.
- name: Set up Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@refs/heads/v1
with:
bundler-cache: true
ruby-version: ruby

- uses: rubygems/release-gem@v1
# zizmor complains that 'v1' is a ref that can be provided by both the branch and tag namespaces.
# specify that we want the v1 branch.
- uses: rubygems/release-gem@refs/heads/v1
8 changes: 7 additions & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
persist-credentials: false

# zizmor complains that 'v1' is a ref that can be provided by both the branch and tag namespaces.
# specify that we want the v1 branch.
- uses: ruby/setup-ruby@refs/heads/v1
with:
ruby-version: 3.4

- run: bundle install
- run: bundle exec rake -t rubocop
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ruby/setup-ruby@v1
persist-credentials: false

# zizmor complains that 'v1' is a ref that can be provided by both the branch and tag namespaces.
# specify that we want the v1 branch.
- uses: ruby/setup-ruby@refs/heads/v1
with:
ruby-version: ${{ matrix.version }}

- run: bundle install
- run: bundle exec rake -t spec
32 changes: 32 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: GitHub Actions Security Analysis with zizmor

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

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

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: false

- name: Run zizmor
run: uvx zizmor --format plain .
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit c268133

Please sign in to comment.