-
Notifications
You must be signed in to change notification settings - Fork 702
[ci] enforce 'zizmor' checks for GitHub Actions configurations #2760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,12 @@ updates: | |
| schedule: | ||
| interval: weekly | ||
| open-pull-requests-limit: 8 | ||
| cooldown: | ||
| default-days: 7 | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I chose this value arbitrarily. And value |
||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: weekly | ||
| open-pull-requests-limit: 5 | ||
| cooldown: | ||
| default-days: 7 | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,9 @@ | ||||||||
| name: ci | ||||||||
| on: [ push, pull_request ] | ||||||||
|
|
||||||||
| permissions: | ||||||||
| contents: read | ||||||||
|
|
||||||||
| jobs: | ||||||||
| lint: | ||||||||
| name: ${{ matrix.component }} ${{ matrix.os }} | ||||||||
|
|
@@ -19,7 +22,9 @@ jobs: | |||||||
| cargo_cmd: clippy --locked --all-targets -- -D warnings -A unknown-lints -A clippy::type_complexity -A clippy::new-without-default | ||||||||
| steps: | ||||||||
| - name: Clone repository | ||||||||
| uses: actions/checkout@v5 | ||||||||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | ||||||||
| with: | ||||||||
| persist-credentials: false | ||||||||
|
|
||||||||
| - name: Install rust | ||||||||
| uses: ./.github/actions/rust-toolchain | ||||||||
|
|
@@ -42,7 +47,9 @@ jobs: | |||||||
| feature: [ azure, gcs, gha, memcached, redis, s3, webdav ] | ||||||||
| steps: | ||||||||
| - name: Clone repository | ||||||||
| uses: actions/checkout@v5 | ||||||||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | ||||||||
| with: | ||||||||
| persist-credentials: false | ||||||||
|
|
||||||||
| - name: Check feature ${{ matrix.feature }} | ||||||||
| run: cargo check --no-default-features --features ${{ matrix.feature }} | ||||||||
|
|
@@ -51,7 +58,9 @@ jobs: | |||||||
| runs-on: ubuntu-latest | ||||||||
| steps: | ||||||||
| - name: Clone repository | ||||||||
| uses: actions/checkout@v5 | ||||||||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | ||||||||
| with: | ||||||||
| persist-credentials: false | ||||||||
|
|
||||||||
| - name: Check | ||||||||
| run: npx --yes @taplo/cli fmt --check | ||||||||
|
|
@@ -130,10 +139,12 @@ jobs: | |||||||
| CARGO_PROFILE_DEV_DEBUG: '0' # save disk space | ||||||||
| steps: | ||||||||
| - if: ${{ contains(matrix.os, 'windows') }} | ||||||||
| uses: ilammy/msvc-dev-cmd@v1 | ||||||||
| uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 | ||||||||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
https://github.com/mozilla/sccache/actions/runs/28532952024 It doesn't show in that output, but I suspect you have a rule like If you like the direction of this PR, then the choices for that list are:
|
||||||||
|
|
||||||||
| - name: Clone repository | ||||||||
| uses: actions/checkout@v5 | ||||||||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | ||||||||
| with: | ||||||||
| persist-credentials: false | ||||||||
|
|
||||||||
| - name: Install rust | ||||||||
| uses: ./.github/actions/rust-toolchain | ||||||||
|
|
@@ -234,7 +245,7 @@ jobs: | |||||||
|
|
||||||||
| - name: Upload coverage results (to Codecov.io) | ||||||||
| if: ${{ ! matrix.no_coverage }} | ||||||||
| uses: codecov/codecov-action@v5 | ||||||||
| uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5 | ||||||||
| with: | ||||||||
| files: ${{ steps.coverage.outputs.report }} | ||||||||
| ## flags: IntegrationTests, UnitTests, ${{ steps.vars.outputs.CODECOV_FLAGS }} | ||||||||
|
|
@@ -306,7 +317,9 @@ jobs: | |||||||
| rustflags: -Ctarget-feature=+crt-static | ||||||||
| steps: | ||||||||
| - name: Clone repository | ||||||||
| uses: actions/checkout@v5 | ||||||||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | ||||||||
| with: | ||||||||
| persist-credentials: false | ||||||||
|
|
||||||||
| - name: Install rust | ||||||||
| uses: ./.github/actions/rust-toolchain | ||||||||
|
|
@@ -374,7 +387,7 @@ jobs: | |||||||
| ID: ${{ startsWith(github.ref, 'refs/tags/') && github.ref || github.sha }} | ||||||||
|
|
||||||||
| - name: Upload artifacts | ||||||||
| uses: actions/upload-artifact@v7 | ||||||||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||||||||
| with: | ||||||||
| name: ${{ matrix.binary || 'sccache' }}-${{ steps.id.outputs.id }}-${{ matrix.target }} | ||||||||
| path: target/${{ matrix.target }}/release/${{ matrix.binary || 'sccache' }}${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }} | ||||||||
|
|
@@ -391,9 +404,11 @@ jobs: | |||||||
| job: | ||||||||
| - { os: ubuntu-22.04 } | ||||||||
| steps: | ||||||||
| - uses: actions/checkout@v5 | ||||||||
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | ||||||||
| with: | ||||||||
| persist-credentials: false | ||||||||
| - name: Prepare, build and test | ||||||||
| uses: vmactions/freebsd-vm@v1 | ||||||||
| uses: vmactions/freebsd-vm@5a72679103d223925653750faa878a143340fbd0 # v1.5.0 | ||||||||
| with: | ||||||||
| mem: 8192 | ||||||||
| usesh: true | ||||||||
|
|
@@ -448,9 +463,13 @@ jobs: | |||||||
| runs-on: ubuntu-latest | ||||||||
| needs: [ build, lint, test ] | ||||||||
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||||||||
| permissions: | ||||||||
| contents: write | ||||||||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sccache/.github/workflows/ci.yml Lines 490 to 492 in 68cd330
This is one thing I've really liked about All other jobs in this workflow should be able to work with just |
||||||||
| steps: | ||||||||
| - name: Clone repository | ||||||||
| uses: actions/checkout@v5 | ||||||||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | ||||||||
| with: | ||||||||
| persist-credentials: false | ||||||||
|
|
||||||||
| - name: Check versions | ||||||||
| run: | | ||||||||
|
|
@@ -463,7 +482,7 @@ jobs: | |||||||
| fi | ||||||||
|
|
||||||||
| - name: Get artifacts | ||||||||
| uses: actions/download-artifact@v8 | ||||||||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||||||||
|
|
||||||||
| - name: Create release assets | ||||||||
| run: | | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dependabot knows how to read these commit SHAs and will update the comments with versions too.
Example: https://github.com/lightgbm-org/LightGBM/pull/7329/changes