Skip to content

Commit

Permalink
chore(scripts/get_tlabel.sh): use 'CI' and 'IMO' labels for maintaine…
Browse files Browse the repository at this point in the history
…r merge (#16726)
  • Loading branch information
jcommelin committed Sep 12, 2024
1 parent 9c09710 commit 0829f93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/get_tlabel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ PR="${1}"

>&2 printf $'Using PR: \'%s\'\n' "${PR}"

tlabels="$(gh api --jq '.labels.[].name' "${PR}" | grep -- '^t-' || printf 'generic\nlabel')"
tlabels="$(gh api --jq '.labels.[].name' "${PR}" | grep -- '^\(t-\|CI\|IMO\)' || printf 'generic\nlabel')"
# print to error, since the stdout is captured into `GITHUB_OUTPUT
>&2 printf 't-labels:\n---\n%s\n---\n' "${tlabels}"
# if there is exactly 1 `t-xxx` label, use `maintainer merge: t-xxx`
# if there isn't exactly 1 `t-xxx` label, use `maintainer merge`
# if there is exactly 1 `t-xxx`, `CI`, or `IMO` label, use `maintainer merge: t-xxx`
# if there isn't exactly 1 `t-xxx`, `CI`, or `IMO` label, use `maintainer merge`
if [[ "$(wc -l <<<"${tlabels}")" -ne 1 ]]; then
topicName="maintainer merge"
else
topicName="maintainer merge: ${tlabels}"
fi

>&2 printf $'Post to topic: \'%s\'"\n' "${topicName}"
>&2 printf $'Post to topic: \'%s\'\n' "${topicName}"
echo "topic=${topicName}"

0 comments on commit 0829f93

Please sign in to comment.