From a2e912d8b5694f930555af0e0c84415dc0780a2c Mon Sep 17 00:00:00 2001 From: Maxwell Huang-Hobbs Date: Wed, 13 Nov 2024 22:02:37 +0000 Subject: [PATCH] publish.yml: don't crash when there are change files --- .github/workflows/publish.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 68622fc..cc484c4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -61,14 +61,16 @@ jobs: git remote set-url origin https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git # Generate changes from beachball, including package.json version bump - yarn beachball bump - - # Check if that contains changefiles - git diff --exit-code -- ./change - echo "OUTPUT_STATUS=$?" >> "$GITHUB_OUTPUT" + if yarn beachball bump | grep "Removing change files:"; then + echo "changes!" + echo "HAS_CHANGES=true" >> "$GITHUB_OUTPUT" + else + echo "no changes!" + echo "HAS_CHANGES=false" >> "$GITHUB_OUTPUT" + fi shell: bash - name: Publish - if: ${{ steps.check_changes.outputs.OUTPUT_STATUS == 1 }} + if: ${{ steps.check_changes.outputs.HAS_CHANGES == true }} run: | git config user.email "mhuan13@gmail.com" git config user.name "$GITHUB_ACTOR"