From 845f86fba2b0fa428818aadebee34818bce7b318 Mon Sep 17 00:00:00 2001 From: danielcristho Date: Thu, 23 Jul 2026 14:37:40 +0700 Subject: [PATCH] ci: add zizmor pre-commit hook, pin actions to SHA, auto-update via dependabot --- .github/dependabot.yml | 23 +++++++++++++++++++++++ .github/workflows/check.yml | 9 +++++++-- .github/workflows/scorecard.yml | 6 +++--- .github/workflows/static.yml | 4 +++- .github/workflows/test.yml | 6 ++++-- .pre-commit-config.yaml | 5 +++++ 6 files changed, 45 insertions(+), 8 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4e2cae5d..0a7ae0f5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,6 +5,25 @@ version: 2 updates: + # Configuration for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + labels: + - "dependencies" + - "github-actions" + commit-message: + prefix: "actions" + include: "scope" + groups: + actions-deps: + patterns: + - "*" + cooldown: + default-days: 7 + # Configuration for Bundler - package-ecosystem: "bundler" directory: "/" @@ -24,6 +43,8 @@ updates: ruby-deps: patterns: - "*" + cooldown: + default-days: 7 # Configuration for pip - package-ecosystem: "pip" @@ -45,3 +66,5 @@ updates: python-deps: patterns: - "*" + cooldown: + default-days: 7 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d964bd3a..aabf4631 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -5,12 +5,17 @@ on: pull_request: branches: ["gh-pages"] +permissions: + contents: read + jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false - uses: astral-sh/setup-uv@a9b33f02405f50e505f17ab8530e42a23200a5d1 with: python-version: "3.13" - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 44e9cf38..7ddf211a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -39,7 +39,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@v2.4.3 + uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 with: results_file: results.sarif results_format: sarif @@ -61,7 +61,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: scorecard-sarif path: results.sarif @@ -70,6 +70,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard (optional). # Commenting out will disable upload of results to your repo's Code Scanning dashboard - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@v4 + uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4 with: sarif_file: results.sarif diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index d36f104a..665bbde7 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -28,8 +28,10 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false - name: Install UV uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - name: Build the site diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 379e3f79..3b8f11a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,9 +16,11 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false - name: Install UV - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4 with: version: "latest" - name: Set up Python diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f16245fb..e2227953 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,6 +32,11 @@ repos: rev: 23.9.1 hooks: - id: black + # Add zizmor + - repo: https://github.com/zizmorcore/zizmor-pre-commit + rev: v1.28.0 + hooks: + - id: zizmor - repo: local hooks: - id: check-author-list