From 2f1a6501813d75588d9d9739be98564a5887253e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nedim=20Salki=C4=87?= Date: Fri, 5 Jul 2024 21:52:48 +0200 Subject: [PATCH] fix: dependabot creates multiple changesets (#2710) --- .github/workflows/pr-validate-changesets.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/pr-validate-changesets.yaml b/.github/workflows/pr-validate-changesets.yaml index 16ec9db40eb..64fbe71ad9e 100644 --- a/.github/workflows/pr-validate-changesets.yaml +++ b/.github/workflows/pr-validate-changesets.yaml @@ -25,21 +25,29 @@ jobs: # see https://github.com/changesets/action/issues/70 persist-credentials: false + - name: Get PR's changeset file + run: | + echo "CHANGESET_FILE=$(git diff --diff-filter=A --name-only origin/${{ github.base_ref }} .changeset/*.md)" >> $GITHUB_ENV + - name: Setup PNPM + if: env.CHANGESET_FILE == '' uses: pnpm/action-setup@v4 with: version: 9.4.0 run_install: true - name: Install jq + if: env.CHANGESET_FILE == '' run: sudo apt-get install -y jq - name: Run dependabot changeset script + if: env.CHANGESET_FILE == '' run: pnpm changeset:dependabot env: PR_TITLE: ${{ github.event.pull_request.title }} - name: Set up .netrc file + if: env.CHANGESET_FILE == '' run: | echo "machine github.com" > $HOME/.netrc echo "login github-actions[bot]" >> $HOME/.netrc @@ -47,6 +55,7 @@ jobs: chmod 600 $HOME/.netrc - name: Commit Changeset + if: env.CHANGESET_FILE == '' run: | git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git config user.name "github-actions[bot]"