diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index cefe8752..893ee9bb 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -18,4 +18,4 @@ jobs: fail-on-severity: high allow-licenses: MIT, Apache-2.0, BSD-3-Clause, ISC, BSD-2-Clause, Unlicense, CC0-1.0, 0BSD, X11, MPL-2.0, MPL-1.0, MPL-1.1, MPL-2.0 fail-on-scopes: development, runtime - allow-dependencies-licenses: 'pkg:npm/caniuse-lite' \ No newline at end of file + allow-dependencies-licenses: 'pkg:npm/caniuse-lite' diff --git a/.github/workflows/unused-dependencies.yml b/.github/workflows/unused-dependencies.yml new file mode 100644 index 00000000..e25beda7 --- /dev/null +++ b/.github/workflows/unused-dependencies.yml @@ -0,0 +1,25 @@ +name: 'Unused Dependencies' +on: [pull_request] + +permissions: + contents: read + +jobs: + unused-dependecies: + runs-on: ubuntu-latest + steps: + - name: 'Checkout Repository' + uses: actions/checkout@v4 + - name: 'Setup Node.js' + uses: actions/setup-node@v4 + with: + node-version: '18.x' + - name: 'Run depcheck' + run: | + npx depcheck --skip-missing --ignores="@babel/*,@commitlint/*,eslint,eslint-*,husky,mocha,concurrently,nyc,prettier" + echo $? + if [[ $? == 1 ]]; then + echo "Unused dependencies or devDependencies found" + exit 1 + fi +