From f4e3367293cd938f088c63a491845cfbeb388d5d Mon Sep 17 00:00:00 2001 From: alefcastelo Date: Mon, 30 Nov 2026 10:37:32 -0600 Subject: [PATCH] Lint workflows with actionlint and zizmor Scope release permissions to the job that needs them, drop the Go cache from the release build, stop persisting checkout credentials, and give Dependabot a 7-day cooldown. Co-Authored-By: Claude Opus 5.5 --- .github/dependabot.yml | 4 ++++ .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 14 ++++++++++---- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d3ca33e..4e38af8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,6 +4,8 @@ updates: directory: / schedule: interval: weekly + cooldown: + default-days: 7 groups: go-minor-patch: update-types: ["minor", "patch"] @@ -12,6 +14,8 @@ updates: directory: / schedule: interval: weekly + cooldown: + default-days: 7 groups: actions-minor-patch: update-types: ["minor", "patch"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f505e53..6dc9620 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: go-version-file: go.mod @@ -24,6 +26,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: go-version-file: go.mod @@ -38,6 +42,8 @@ jobs: coverage: ${{ steps.coverage.outputs.total }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: go-version-file: go.mod @@ -63,6 +69,8 @@ jobs: group: coverage-badge steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: true # zizmor: ignore[artipacked] the next step pushes the badge with these credentials; this job uploads no artifacts - env: COVERAGE: ${{ needs.test.outputs.coverage }} run: | @@ -83,6 +91,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: go-version-file: go.mod @@ -93,22 +103,45 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: go-version-file: go.mod cache: true - run: go run github.com/fe3dback/go-arch-lint@v1.18.0 check --project-path . + workflow-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 + with: + go-version-file: go.mod + cache: true + - run: go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 + - uses: zizmorcore/zizmor-action@1b4550e929643b8b26a62303c6bd64814271a4f1 # v0.9.2 + with: + version: 1.33.1 + advanced-security: false + annotations: true + shellcheck: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - run: shellcheck install.sh tests/e2e/setup_suite.bash e2e: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: go-version-file: go.mod diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 452b163..3ddc1ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,21 +4,23 @@ on: push: tags: ["v*.*.*"] -permissions: - contents: write - packages: write +permissions: {} jobs: goreleaser: runs-on: ubuntu-latest + permissions: + contents: write + packages: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 + persist-credentials: false - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: go-version-file: go.mod - cache: true + cache: false - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: @@ -40,8 +42,12 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} + permissions: + contents: read steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - run: sh install.sh -b "$RUNNER_TEMP/bin" "$GITHUB_REF_NAME" - run: | version=$("$RUNNER_TEMP/bin/bidirekt" version)