From e8458415e04cb342b9b4683390d6196d389db264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niko=20B=C3=B6ckerman?= Date: Wed, 4 Dec 2024 18:04:03 +0000 Subject: [PATCH] ci: Check whether npm deduping is needed --- .github/workflows/check-npm.yaml | 23 +++++++++++++++++++++++ package.json | 1 + taskfile.yaml | 4 ++++ 3 files changed, 28 insertions(+) create mode 100644 .github/workflows/check-npm.yaml diff --git a/.github/workflows/check-npm.yaml b/.github/workflows/check-npm.yaml new file mode 100644 index 0000000..0bc4260 --- /dev/null +++ b/.github/workflows/check-npm.yaml @@ -0,0 +1,23 @@ +name: Check - npm and dependencies + +on: + pull_request: + paths: + - ".github/actions/npm-tools-setup/**" + - ".github/workflows/check-npm.yaml" + - "package.json" + - "package-lock.json" + workflow_call: + workflow_dispatch: + +jobs: + duplicate-dependencies: + name: Check for duplicate dependencies + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: Setup npm tools + uses: ./.github/actions/npm-tools-setup + - name: Check for duplicate dependencies + run: npm run check:npm:dedupe diff --git a/package.json b/package.json index b12ddf3..521c953 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "scripts": { "check:github-actions": "git ls-files '.github/**.yaml' | xargs -t -I {} action-validator {}", + "check:npm:dedupe": "npm find-dupes", "check:prettier": "prettier --check .", "check:renovateconfig": "npx --package=renovate -- renovate-config-validator --strict", "fix:prettier": "prettier --write ." diff --git a/taskfile.yaml b/taskfile.yaml index 540b04c..862add3 100644 --- a/taskfile.yaml +++ b/taskfile.yaml @@ -10,6 +10,10 @@ tasks: desc: "Check - Github actions" cmds: - npm run check:github-actions + check:npm:dedupe: + desc: "Check - npm dedupe" + cmds: + - npm run check:npm:dedupe check:prettier: desc: "Check - prettier" cmds: