From b8850aba72ab5fc3336c29da0c1ec2d1d413e23b Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Tue, 9 Jul 2024 15:21:08 -0600 Subject: [PATCH] =?UTF-8?q?Revert=20"Revert=20"Revert=20"fix:=20skip=20PR?= =?UTF-8?q?=20creation=20if=20no=20prerelease=20changesets=20exi=E2=80=A6"?= =?UTF-8?q?=20(#11942)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 165c4e4ffee2f2f36897100af2889b1e600c527b. --- .github/workflows/prerelease.yml | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 586a3477e61..a0b28b74a3c 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -73,25 +73,10 @@ jobs: git commit -m 'Enter prerelease mode' git push - - name: Get prerelease changesets - id: prerelease-changesets - uses: notiz-dev/github-action-json-property@release - with: - path: ".changeset/pre.json" - prop_path: "changesets" - - - name: Get changesets array length - id: number-of-changesets - run: | - arrayLength=$(echo '${{steps.prerelease-changesets.outputs.prop}}' | jq '. | length') - echo "length=$arrayLength" >> "$GITHUB_OUTPUT" - - name: Create prerelease PR - # Only attempt to create a PR if: - # 1. .changeset/pre.json exists - # 2. we are not actively publishing after merging a Version Packages PR - # 3. AND we have prerelease changesets to publish (otherwise it errors) - if: steps.check_files.outputs.files_exists == 'true' && !startsWith(github.event.head_commit.message, 'Version Packages') && steps.number-of-changesets.outputs.length > 0 + # If .changeset/pre.json exists and we are not currently cutting a + # release after merging a Version Packages PR + if: steps.check_files.outputs.files_exists == 'true' && !startsWith(github.event.head_commit.message, 'Version Packages') uses: changesets/action@v1 with: version: npm run changeset-version @@ -100,8 +85,8 @@ jobs: - name: Publish to npm + GitHub id: changesets - # Only publish if we're still in pre mode and the last commit was - # from an automatically created Version Packages PR + # Only run publish if we're still in pre mode and the last commit was + # via an automatically created Version Packages PR if: steps.check_files.outputs.files_exists == 'true' && startsWith(github.event.head_commit.message, 'Version Packages') uses: changesets/action@v1 with: