mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
simple backport script
This commit is contained in:
parent
6bd80a357b
commit
204a6b2b8c
@ -56,38 +56,12 @@ do
|
||||
action="backport"
|
||||
fi
|
||||
|
||||
# Next, check the tag. They might override the decision.
|
||||
matched_labels=()
|
||||
for label in $(jq -r .labels[].name "$file")
|
||||
do
|
||||
label_action=""
|
||||
case "$label" in
|
||||
pr-must-backport | "v$branch-must-backport")
|
||||
label_action="backport"
|
||||
;;
|
||||
pr-no-backport | "v$branch-no-backport")
|
||||
label_action="no-backport"
|
||||
;;
|
||||
"v$branch-conflicts")
|
||||
label_action="conflict"
|
||||
;;
|
||||
"v$branch" | "v$branch-backported")
|
||||
label_action="done"
|
||||
;;
|
||||
esac
|
||||
if [ "$label_action" != "" ]
|
||||
then
|
||||
action="$label_action"
|
||||
matched_labels+=("$label")
|
||||
fi
|
||||
done
|
||||
|
||||
# Show an error if there are conflicting labels.
|
||||
if [ ${#matched_labels[@]} -gt 1 ]
|
||||
then
|
||||
>&2 echo "PR #$pr has conflicting labels: ${matched_labels[*]}"
|
||||
continue
|
||||
fi
|
||||
# Next, check the tag. They might override the decision. Checks are ordered by priority.
|
||||
labels="$(jq -r .labels[].name "$file")"
|
||||
if echo "$labels" | grep "pr-must-backport\|v$branch-must-backport" > /dev/null; then action="backport"; fi
|
||||
if echo "$labels" | grep "v$branch-conflicts" > /dev/null; then action="conflict"; fi
|
||||
if echo "$labels" | grep "pr-no-backport\|v$branch-no-backport" > /dev/null; then action="no-backport"; fi
|
||||
if echo "$labels" | grep "v$branch\|v$branch-backported" > /dev/null; then action="done"; fi
|
||||
|
||||
# Find merge commit SHA for convenience
|
||||
merge_sha="$(jq -r .merge_commit_sha "$file")"
|
||||
|
Loading…
Reference in New Issue
Block a user