You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EXISTING=$(gh pr list --head "${BRANCH}" --state open --json number --jq '.[0].number')
87
100
if [ -n "$EXISTING" ]; then
88
101
echo "Updated branch for existing test PR #${EXISTING}."
89
102
gh pr comment "${EXISTING}" \
90
103
--body "Branch updated with latest commits from community PR #${COMMUNITY_PR_NUMBER}."
91
-
exit 0
104
+
else
105
+
PR_BODY=$(printf '%s\n\n%s\n%s\n%s\n\n%s' \
106
+
"Automated test PR to run CI on behalf of community PR #${COMMUNITY_PR_NUMBER}." \
107
+
"**Original PR:** ${COMMUNITY_PR_URL}" \
108
+
"**Author:** @${COMMUNITY_PR_AUTHOR}" \
109
+
"**Fork:** \`${COMMUNITY_PR_FORK}\`" \
110
+
"> **Note:** This PR was created automatically when the \`ok-to-test\` label was applied. Do not merge — close it once tests complete and review the original PR instead.")
111
+
112
+
gh pr create \
113
+
--title "[Test] Community PR #${COMMUNITY_PR_NUMBER}: ${COMMUNITY_PR_TITLE}" \
114
+
--body "${PR_BODY}" \
115
+
--base main \
116
+
--head "${BRANCH}"
92
117
fi
93
118
94
-
PR_BODY=$(printf '%s\n\n%s\n%s\n%s\n\n%s' \
95
-
"Automated test PR to run CI on behalf of community PR #${COMMUNITY_PR_NUMBER}." \
96
-
"**Original PR:** ${COMMUNITY_PR_URL}" \
97
-
"**Author:** @${COMMUNITY_PR_AUTHOR}" \
98
-
"**Fork:** \`${COMMUNITY_PR_FORK}\`" \
99
-
"> **Note:** This PR was created automatically when the \`ok-to-test\` label was applied. Do not merge — close it once tests complete and review the original PR instead.")
100
-
101
-
gh pr create \
102
-
--title "[Test] Community PR #${COMMUNITY_PR_NUMBER}: ${COMMUNITY_PR_TITLE}" \
0 commit comments