ci: Fix refresh failure on branch differences

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2020-10-18 02:49:19 +02:00
parent 141b529c73
commit c6611ca1b6
+4 -3
View File
@@ -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