File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments