From 85fcc10e80e493ae427ebaad75dca0ea7b024e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 5 Mar 2026 17:06:29 +0100 Subject: [PATCH] ci: dedupe all lockfiles conditionally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only dedupe each lockfile if it was actually changed by Dependabot. Covers root (Yarn 4) and docs-ui/microsite (Yarn Classic) lockfiles. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Fredrik Adelöw --- .../workflows/sync_dependabot-changesets.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sync_dependabot-changesets.yml b/.github/workflows/sync_dependabot-changesets.yml index ef0efe04f9..2974407872 100644 --- a/.github/workflows/sync_dependabot-changesets.yml +++ b/.github/workflows/sync_dependabot-changesets.yml @@ -29,11 +29,23 @@ jobs: uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 20 - - name: Dedupe lockfile + - name: Dedupe lockfiles run: | corepack enable - yarn dedupe - git add yarn.lock + + # Root lockfile (Yarn 4) + if git diff --name-only HEAD~1 | grep -q '^yarn\.lock$'; then + yarn dedupe + git add yarn.lock + fi + + # Subdirectory lockfiles (Yarn Classic) + for dir in docs-ui microsite; do + if git diff --name-only HEAD~1 | grep -q "^${dir}/yarn.lock$"; then + npx yarn-deduplicate "$dir/yarn.lock" + git add "$dir/yarn.lock" + fi + done - name: Generate changeset uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: