Skip to content

Commit

Permalink
Don't exit when push doesn't fail
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <[email protected]>
  • Loading branch information
pierDipi committed Oct 2, 2024
1 parent bc75f08 commit 1fe0ed0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 28 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/release-generate-ci-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/release.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/release.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand All @@ -113,8 +112,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/hack.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/hack.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand Down
33 changes: 11 additions & 22 deletions .github/workflows/release-generate-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/release.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/release.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand All @@ -176,8 +175,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/hack.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/hack.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand All @@ -202,8 +200,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand All @@ -227,8 +224,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand All @@ -252,8 +248,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand All @@ -277,8 +272,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand All @@ -302,8 +296,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand All @@ -327,8 +320,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand All @@ -352,8 +344,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand All @@ -377,8 +368,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand All @@ -402,8 +392,7 @@ jobs:
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand Down
3 changes: 1 addition & 2 deletions pkg/action/update_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ git remote add fork "https://github.com/serverless-qe/$repo.git" || true # ignor
remote_exists=$(git ls-remote --heads fork "$branch")
if [ -z "$remote_exists" ]; then
# remote doesn't exist.
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f
exit $?
git push "https://serverless-qe:${GH_TOKEN}@github.com/serverless-qe/$repo.git" "$branch:$branch" -f || exit 1
fi
git fetch fork "$branch"
if git diff --quiet "fork/$branch" "$branch"; then
Expand Down

0 comments on commit 1fe0ed0

Please sign in to comment.