diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15d55ce8c0..62d8c16434 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,17 @@ jobs: - name: Stop Nx Agents if: ${{ always() }} run: npx nx-cloud stop-all-agents + - name: Check for Changesets marked as major + id: major + run: | + echo "found=false" >> $GITHUB_OUTPUT + regex="(major)" + shopt -s nullglob + for file in .changeset/*.md; do + if [[ $(cat $file) =~ $regex ]]; then + echo "found=true" >> $GITHUB_OUTPUT + fi + done - name: Run Changesets (version or publish) id: changesets uses: changesets/action@v1.5.3 @@ -49,7 +60,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Auto-merge Changesets PR - if: steps.changesets.outputs.hasChangesets == 'true' + if: steps.changesets.outputs.hasChangesets == 'true' && steps.major.outputs.found == 'false' run: | gh pr merge --squash "$PR_NUMBER" gh api --method POST /repos/$REPO/dispatches -f 'event_type=release'