From c677909dc9370f96a21d94efb9634f3a796de9f1 Mon Sep 17 00:00:00 2001 From: tomas Date: Mon, 20 Jul 2026 09:31:35 +0000 Subject: [PATCH] ci: disable persisted credentials in checkout steps Set `persist-credentials: false` on every `actions/checkout` step in the CD, CI and dependency-check workflows, so the GitHub token is not left behind in the local Git config while repository-controlled npm commands run. This shortens the window in which the workflow token is available to build and packaging steps. All affected jobs are read-only: none push, tag, or otherwise use the persisted credentials, and both `permissions:` blocks are already `contents: read`. The qlty job keeps `fetch-depth: 0` (credentials are only dropped after the fetch), and the drift check's `git diff` is a purely local operation, so checkout behaviour is otherwise unchanged. `.github/workflows/e2e.yml` already set the flag and is left untouched. Closes #444 Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01129DHTrr8BrrnBCaiLVzYv --- .github/workflows/cd.yml | 2 ++ .github/workflows/ci.yml | 17 +++++++++++++++++ .github/workflows/deps.yml | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 473d733d08..175eac90d1 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -22,6 +22,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc1833d747..a9030540cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 @@ -46,6 +48,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 @@ -69,6 +73,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 + persist-credentials: false - name: Install qlty uses: qltysh/qlty-action/install@141b881236146435192435eb7b0e06ea0b70b4d9 @@ -89,6 +94,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 @@ -141,6 +148,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 @@ -161,6 +170,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 @@ -181,6 +192,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 @@ -202,6 +215,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 @@ -223,6 +238,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml index f4e70908ea..1ce1a56a7a 100644 --- a/.github/workflows/deps.yml +++ b/.github/workflows/deps.yml @@ -21,6 +21,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 @@ -50,6 +52,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6