diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ca79ca5..f46cfb0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,4 +3,7 @@ updates: - package-ecosystem: github-actions directory: / schedule: - interval: weekly + interval: monthly + cooldown: + default-days: 7 + open-pull-requests-limit: 2 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0653305..82775ef 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -27,14 +27,19 @@ jobs: - macos-latest - windows-latest steps: + - name: Harden runner + uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 + with: + egress-policy: audit # Audit network and disk activity + - name: Check out code id: checkout - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 1 - name: Setup Go - uses: actions/setup-go@v7 + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: './go.mod' check-latest: true @@ -47,14 +52,14 @@ jobs: echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" - name: cache restore - GOCACHE - uses: actions/cache/restore@v6 + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ steps.go-cache-paths.outputs.go-build }} key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} enableCrossOsArchive: true - name: cache restore - GOMODCACHE - uses: actions/cache/restore@v6 + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ steps.go-cache-paths.outputs.go-mod }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} @@ -65,7 +70,7 @@ jobs: run: go test -race -cover -coverprofile=coverage.out ./... - name: Upload coverage - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ runner.os }}-coverage.out path: ./coverage.out @@ -74,6 +79,11 @@ jobs: ci_mergeable: runs-on: ubuntu-latest steps: + - name: Harden runner + uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 + with: + egress-policy: audit # Audit network and disk activity + - run: true needs: - go_test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b08c23b..a0243db 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,14 +22,19 @@ jobs: name: lint runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v7 - - uses: actions/setup-go@v7 + - name: Harden runner + uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 + with: + egress-policy: audit # Audit network and disk activity + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: './go.mod' check-latest: true - name: golangci-lint - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9 + uses: step-security/golangci-lint-action@ce3368d2f0a15c79206a120861e3f847c8beb466 # v9.2.1 with: skip-save-cache: true @@ -43,7 +48,12 @@ jobs: name: govulncheck runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v7 + - name: Harden runner + uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 + with: + egress-policy: audit # Audit network and disk activity + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - id: govulncheck uses: golang/govulncheck-action@032d45514ae346b1db93c04b0c90b841c370344f # v1.1.0 @@ -54,9 +64,14 @@ jobs: actionlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - name: Harden runner + uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 + with: + egress-policy: audit # Audit network and disk activity + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up Go 1.x - uses: actions/setup-go@v7 + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: './go.mod' check-latest: true @@ -75,6 +90,11 @@ jobs: lint_mergeable: runs-on: ubuntu-latest steps: + - name: Harden runner + uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 + with: + egress-policy: audit # Audit network and disk activity + - run: true needs: - golangci