From 3f79e64062a22dcd18ad9e9370ecdb4ace03f789 Mon Sep 17 00:00:00 2001 From: Ming-jun Lu <40516784+mingjunlu@users.noreply.github.com> Date: Tue, 6 Feb 2024 14:54:56 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=97=EF=B8=8F=20Run=20`pnpm=20dedupe`=20fo?= =?UTF-8?q?r=20Dependabot=20PRs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See: https://github.com/dependabot/dependabot-core/issues/5830 --- .github/workflows/dependabot-dedupe.yaml | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/dependabot-dedupe.yaml diff --git a/.github/workflows/dependabot-dedupe.yaml b/.github/workflows/dependabot-dedupe.yaml new file mode 100644 index 00000000..8d001f4c --- /dev/null +++ b/.github/workflows/dependabot-dedupe.yaml @@ -0,0 +1,38 @@ +name: Deduplicate Dependabot PRs +on: + push: + branches: + - 'dependabot/npm_and_yarn/*' + paths: + - 'package.json' +permissions: + content: write +jobs: + dedupe: + name: Deduplicate dependencies + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Set up pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Install dependencies + run: pnpm install --frozen-lockfile --ignore-scripts + - name: Deduplicate dependencies + run: pnpm dedupe + - name: Set up Git + run: | + git config user.name "github-actions[bot]" + git config user.email "49699333+dependabot[bot]@users.noreply.github.com" + - name: Commit and push changes + run: | + git add pnpm-lock.yaml + git commit -m "♻️ Deduplicate dependencies [dependabot skip]" || echo "No changes to commit" + git push origin ${{ github.ref_name }}