File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -62,15 +62,24 @@ jobs:
62
62
echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV
63
63
64
64
- name : Create PR '${{ env.PR_TITLE }}'
65
+ env :
66
+ PR_BODY : |
67
+ This PR was created to prepare for releasing ${{ env.TAG_PREFIX }}${{ env.RELEASE_VERSION }}.
68
+
69
+ Merging this PR will create the GitHub release ${{ env.TAG_PREFIX }}${{ env.RELEASE_VERSION }}.
65
70
run : |
66
71
PR_LABELS="automated-pr,${RELEASE_TYPE}-pr"
67
72
for LABEL in $(echo $PR_LABELS | sed "s/,/ /g"); do gh label create $LABEL --force; done
68
73
[[ ${PRE_RELEASE:false} == "true" ]] && gh label create 'pre-release' --force
69
74
70
- gh pr create \
71
- --draft \
72
- --base ${{ env.BRANCH_MAIN }} \
73
- --head ${{ github.ref_name }} \
74
- --title "${{ env.PR_TITLE }}" \
75
- --label "${{ env.PR_LABELS }}" \
76
- --fill
75
+ PR_ID=$(gh pr list --state open --search "base:${{ env.BRANCH_MAIN }} head:${{ github.ref_name }}" | head -1 | cut -f1)
76
+ [[ ! -z "$PR_ID" ]] && \
77
+ gh pr create \
78
+ --draft \
79
+ --base "${{ env.BRANCH_MAIN }}" \
80
+ --head "${{ github.ref_name }}" \
81
+ --title "${{ env.PR_TITLE }}" \
82
+ --body "${{ env.PR_BODY }}" \
83
+ --label "${PR_LABELS}" \
84
+ --fill \
85
+ || echo "PR was created. Ignored!"
You can’t perform that action at this time.
0 commit comments