Commit 7cd47a0 1 parent 3f8c981 commit 7cd47a0 Copy full SHA for 7cd47a0
File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -86,13 +86,17 @@ body="Update $repo version to \`$latest_version\`.
86
86
See https://github.com/open-telemetry/$repo /releases/tag/$latest_version ."
87
87
branch=" opentelemetrybot/auto-update-$repo -$latest_version "
88
88
89
+ echo " Looking for existing PRs with branch '$branch '."
89
90
existing_pr_all=$( gh pr list --state all --head " $branch " )
90
- existing_pr_count=$( echo " $existing_pr_all " | wc -l)
91
- if [ " $existing_pr_count " -gt 0 ]; then
91
+ # `gh pr list` is a list of PRs, each line starting with a PR number if there's
92
+ # a match. Otherwise returns "no ... matches". Test for PR number:
93
+ if [[ " $existing_pr_all " =~ ^[0-9] ]]; then
92
94
echo " PR(s) already exist for '$message ':"
93
95
echo $existing_pr_all
94
96
echo " So we won't create another. Exiting."
95
97
exit 0
98
+ else
99
+ echo " None found."
96
100
fi
97
101
98
102
if [[ " $repo " == " opentelemetry-specification"
You can’t perform that action at this time.
0 commit comments