diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5353bf7..b1da0af 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -100,18 +100,23 @@ jobs: GH_TOKEN: ${{ steps.generate_token.outputs.token }} run: | pr_number="${{ needs.prerelease.outputs.pr_number }}" - while true; do - pr_state=$(gh pr view $pr_number --json state -q .state) - if [ "$pr_state" = "MERGED" ]; then - echo "PR has been merged" - break - elif [ "$pr_state" = "CLOSED" ]; then - echo "PR was closed without merging" - exit 1 - fi - echo "Waiting for PR to be merged..." - sleep 10 - done + if [ -z "$pr_number" ]; then + echo "No PR was created, skipping wait step" + else + echo "Waiting for PR $pr_number to be merged..." + while true; do + pr_state=$(gh pr view $pr_number --json state -q .state) + if [ "$pr_state" = "MERGED" ]; then + echo "PR has been merged" + break + elif [ "$pr_state" = "CLOSED" ]; then + echo "PR was closed without merging" + exit 1 + fi + echo "Waiting for PR to be merged..." + sleep 10 + done + fi - name: "🚀 release" id: semantic-release