Skip to content

Commit 51d0ad8

Browse files
authored
Merge pull request #100 from AnthonyGress/dev
don't fail on unsquashed pr
2 parents a8005db + 8755fff commit 51d0ad8

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,19 @@ jobs:
8585
PR_NUM=$(echo "$COMMIT_MSG" | grep -o "#[0-9]\+" | head -1 | tr -d "#")
8686
8787
if [ -n "$PR_NUM" ]; then
88-
# PR number found, get commits from this PR
88+
# PR number found, try to get commits from this PR
8989
echo "### $COMMIT_MSG" >> release_notes.md
9090
91-
PR_COMMITS=$(gh pr view $PR_NUM --json commits --jq '.commits[].messageHeadline')
91+
# Check if PR exists before trying to view it
92+
if gh pr view $PR_NUM --json number &>/dev/null; then
93+
PR_COMMITS=$(gh pr view $PR_NUM --json commits --jq '.commits[].messageHeadline')
9294
93-
if [ -n "$PR_COMMITS" ]; then
94-
# Add indented PR commits to notes, but filter out the main PR commit
95-
echo "$PR_COMMITS" | grep -v "Merge" | grep -v "$COMMIT_MSG" | sed 's/^/ - /' >> release_notes.md
95+
if [ -n "$PR_COMMITS" ]; then
96+
# Add indented PR commits to notes, but filter out the main PR commit
97+
echo "$PR_COMMITS" | grep -v "Merge" | grep -v "$COMMIT_MSG" | sed 's/^/ - /' >> release_notes.md
98+
fi
99+
else
100+
echo " - PR #$PR_NUM not found or not accessible" >> release_notes.md
96101
fi
97102
else
98103
# Regular commit, not from a squashed PR

0 commit comments

Comments
 (0)