From b7948f1bace9a9aa42d8d963ce03ba7f8fa3a761 Mon Sep 17 00:00:00 2001 From: Ville Vesilehto Date: Tue, 24 Mar 2026 19:29:48 +0200 Subject: [PATCH] ci: add persist-credentials: false to checkouts (#7964) --- .github/workflows/codeql-analysis.yml | 2 ++ .github/workflows/depsreview.yml | 2 ++ .github/workflows/docker.yml | 2 ++ .github/workflows/go.test.yml | 8 ++++++++ .github/workflows/golangci-lint.yml | 2 ++ .github/workflows/release.yml | 1 + .github/workflows/trivy-scan.yaml | 2 ++ 7 files changed, 19 insertions(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b93d7acc9..ec408025b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -28,6 +28,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Initialize CodeQL uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 diff --git a/.github/workflows/depsreview.yml b/.github/workflows/depsreview.yml index 0e73ef5c8..6c589b622 100644 --- a/.github/workflows/depsreview.yml +++ b/.github/workflows/depsreview.yml @@ -10,5 +10,7 @@ jobs: steps: - name: 'Checkout Repository' uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: 'Dependency Review' uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8d2a6f5ad..22dcca037 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,6 +19,8 @@ jobs: RELEASE: ${{ github.event.inputs.release || github.event.release.tag_name }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Build Docker Images run: make VERSION=${RELEASE:1} DOCKER=coredns -f Makefile.docker release - name: Show Docker Images diff --git a/.github/workflows/go.test.yml b/.github/workflows/go.test.yml index 4b88f2462..76a640e6c 100644 --- a/.github/workflows/go.test.yml +++ b/.github/workflows/go.test.yml @@ -10,6 +10,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Install Go uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 @@ -32,6 +34,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Install Go uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 @@ -51,6 +55,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Install Go uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 @@ -72,6 +78,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Install dependencies run: sudo apt-get install make curl diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 47628e33c..f72ecf028 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -12,6 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 with: go-version-file: .go-version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c7d21e90..56cdcf1d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ github.event.inputs.commit }} + persist-credentials: false - name: Set up info run: | set -x -e diff --git a/.github/workflows/trivy-scan.yaml b/.github/workflows/trivy-scan.yaml index 4dfb2a0b9..27cd43b6a 100644 --- a/.github/workflows/trivy-scan.yaml +++ b/.github/workflows/trivy-scan.yaml @@ -19,6 +19,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # master with: