Skip to content

Commit

Permalink
added a check if no PR is created for the wait for PR step
Browse files Browse the repository at this point in the history
  • Loading branch information
nickytonline committed Sep 6, 2024
1 parent 505573d commit 9e20c1e
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9e20c1e

Please sign in to comment.