ci: Fix refresh failure on branch differences
This commit is contained in:
@@ -62,9 +62,8 @@ jobs:
|
|||||||
BRANCHES[${#BRANCHES[@]}]="oldabi"
|
BRANCHES[${#BRANCHES[@]}]="oldabi"
|
||||||
|
|
||||||
for d in ${BRANCHES[@]}; do
|
for d in ${BRANCHES[@]}; do
|
||||||
echo "Testing ${d}"
|
if ! git diff -s --exit-code origin/${d} remote/${d}; then
|
||||||
git diff -s --exit-code origin/${d} remote/${d}
|
echo "Branch '${d}' requires update."
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
git checkout -b ${d} origin/${d}
|
git checkout -b ${d} origin/${d}
|
||||||
git push --set-upstream origin ${d}
|
git push --set-upstream origin ${d}
|
||||||
curl \
|
curl \
|
||||||
@@ -73,5 +72,7 @@ jobs:
|
|||||||
-H "Accept: application/vnd.github.v3+json" \
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
-d "{\"ref\":\"automation\",\"inputs\":{\"ref\":\"${d}\"}}" \
|
-d "{\"ref\":\"automation\",\"inputs\":{\"ref\":\"${d}\"}}" \
|
||||||
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yml/dispatches"
|
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yml/dispatches"
|
||||||
|
else
|
||||||
|
echo "Branch '${d}' is up to date."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user