[action] Fix auto merge workflow commit message. (#15450)

Why I did it
Refine submodule update commit message.

Work item tracking
Microsoft ADO (number only): 24253804
This commit is contained in:
Liu Shilong 2023-06-19 08:31:56 +08:00 committed by GitHub
parent 08affc9f00
commit bee87909e7
No account linked to committer's email address

View File

@ -26,6 +26,8 @@ jobs:
for ((i=0;i<$count;i++)) for ((i=0;i<$count;i++))
do do
url=$(cat prs.log | jq -r ".[$i].url") url=$(cat prs.log | jq -r ".[$i].url")
body=$(cat prs.log | jq -r ".[$i].body")
title=$(cat prs.log | jq -r ".[$i].title")
created_at=$(cat prs.log | jq -r ".[$i].createdAt") created_at=$(cat prs.log | jq -r ".[$i].createdAt")
echo PR: $(($i+1))/$count, URL: $url, createdAt: $created_at, now: $(date -u +"%FT%TZ") echo PR: $(($i+1))/$count, URL: $url, createdAt: $created_at, now: $(date -u +"%FT%TZ")
[[ "$url" == "" ]] && continue [[ "$url" == "" ]] && continue
@ -68,6 +70,10 @@ jobs:
done done
# merge the PR # merge the PR
echo ========Merging PR======== echo ========Merging PR========
if echo $title | grep "^\[submodule\]";then
gh pr merge --squash --admin -R sonic-net/sonic-buildimage $url -b "$body" || true
else
gh pr merge --rebase --admin -R sonic-net/sonic-buildimage $url || true gh pr merge --rebase --admin -R sonic-net/sonic-buildimage $url || true
fi
echo ========Finished PR======== echo ========Finished PR========
done done