[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 known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,8 @@ jobs:
for ((i=0;i<$count;i++))
do
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")
echo PR: $(($i+1))/$count, URL: $url, createdAt: $created_at, now: $(date -u +"%FT%TZ")
[[ "$url" == "" ]] && continue
@ -68,6 +70,10 @@ jobs:
done
# merge the PR
echo ========Merging PR========
gh pr merge --rebase --admin -R sonic-net/sonic-buildimage $url || true
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
fi
echo ========Finished PR========
done