diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 807baca..d770afb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,3 +8,5 @@ updates: directory: "/" schedule: interval: "daily" + cooldown: + default-days: 7 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 77de70c..dd57438 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,10 @@ on: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: cgroup-v2: name: "cgroup v2 (Ubuntu 26.04)" @@ -28,8 +32,10 @@ jobs: runs-on: ubuntu-26.04 steps: - - uses: actions/checkout@v7 - - uses: actions/setup-go@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version: ${{ matrix.go-version }} go-version-file: go.mod # Take version from go.mod when go-version is empty. @@ -40,12 +46,14 @@ jobs: timeout-minutes: 20 runs-on: ubuntu-26.04 steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - - uses: lima-vm/lima-actions/setup@v1 + - uses: lima-vm/lima-actions/setup@55627e31b78637bf254a8b2a14da8ea7d12564e5 # v1.1.0 id: lima-actions-setup - - uses: actions/cache@v6 + - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ~/.cache/lima key: lima-${{ steps.lima-actions-setup.outputs.version }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 71accb3..461208a 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -13,22 +13,26 @@ on: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: lint: timeout-minutes: 30 permissions: contents: read - pull-requests: read checks: write # to allow the action to annotate code in the PR. runs-on: ubuntu-26.04 steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: + persist-credentials: false fetch-depth: 2 - - uses: actions/setup-go@v7 + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version: stable - - uses: golangci/golangci-lint-action@v9 + - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 # Extra linters, only checking new code from a pull request. - name: lint-extra if: github.event_name == 'pull_request' @@ -38,7 +42,9 @@ jobs: codespell: runs-on: ubuntu-26.04 steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: install deps # Use a known version of codespell. run: pip install --break-system-packages codespell==v2.4.3 @@ -48,14 +54,18 @@ jobs: space-at-eol: runs-on: ubuntu-26.04 steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - run: if git -P grep -I -n '\s$'; then echo "^^^ extra whitespace at EOL, please fix"; exit 1; fi deps: runs-on: ubuntu-26.04 steps: - - uses: actions/checkout@v7 - - uses: actions/setup-go@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version: stable - run: go mod tidy --diff @@ -63,7 +73,19 @@ jobs: govulncheck: runs-on: ubuntu-26.04 steps: - - uses: golang/govulncheck-action@v1 + - uses: golang/govulncheck-action@032d45514ae346b1db93c04b0c90b841c370344f # v1.1.0 + + zizmor: + runs-on: ubuntu-26.04 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4 + with: + version: 1.30.0 + advanced-security: false + annotations: true all-done: needs: @@ -72,6 +94,7 @@ jobs: - govulncheck - lint - space-at-eol + - zizmor runs-on: ubuntu-26.04 steps: - run: echo "All jobs completed" diff --git a/.github/zizmor.yml b/.github/zizmor.yml new file mode 100644 index 0000000..77224a4 --- /dev/null +++ b/.github/zizmor.yml @@ -0,0 +1,24 @@ +# Configuration for zizmor (https://docs.zizmor.sh/), run by the zizmor job +# in .github/workflows/validate.yml. + +rules: + cache-poisoning: + # The audit fires because both workflows are also triggered by pushing a + # v* tag, so anything they cache is, in zizmor's view, a possible input to + # a release build. That does not hold here: + # + # - This is a library: no job produces any release artifacts, and the + # workflows only run tests and linters. + # + # - GitHub scopes caches per branch: a pull request can read the default + # branch's cache, but cannot write to it. So a pull request cannot plant + # an entry that a later push or tag build would restore. + # + # The alternative (cache: false everywhere) makes every Go job re-download + # modules and start from a cold build cache, which is a real slowdown for + # no gain. + # + # Revisit this if a job ever starts publishing artifacts. + ignore: + - test.yml + - validate.yml