Skip to content

Commit

Permalink
Fix CI: check existing remote branch condition (#2837)
Browse files Browse the repository at this point in the history
  • Loading branch information
antgamdia committed May 19, 2021
1 parent e832985 commit f0b36fc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions script/chart_sync_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ commitAndSendExternalPR() {
git add --all .
git commit -m "kubeapps: bump chart version to $chartVersion"
# NOTE: This expects to have a loaded SSH key
if [[ -n "$(git ls-remote origin $targetBranch | wc -l)" ]]; then
echo "The remote branch '$targetBranch' already exists, please check if there is already an open PR at the repository '${CHARTS_REPO_ORIGINAL}'"
else
if [[ $(git ls-remote origin $targetBranch | wc -l) -eq 0 ]] ; then
git push -u origin $targetBranch
gh pr create -d -B master -R ${CHARTS_REPO_ORIGINAL} -F ${PR_EXTERNAL_TEMPLATE_FILE} --title "[bitnami/kubeapps] Bump chart version to $chartVersion"
else
echo "The remote branch '$targetBranch' already exists, please check if there is already an open PR at the repository '${CHARTS_REPO_ORIGINAL}'"
fi
cd -
}
Expand All @@ -200,11 +200,11 @@ commitAndSendInternalPR() {
git add --all .
git commit -m "bump chart version to $chartVersion"
# NOTE: This expects to have a loaded SSH key
if [[ -n "$(git ls-remote origin $targetBranch | wc -l)" ]]; then
echo "The remote branch '$targetBranch' already exists, please check if there is already an open PR at the repository '${KUBEAPPS_REPO}'"
else
if [[ $(git ls-remote origin $targetBranch | wc -l) -eq 0 ]] ; then
git push -u origin $targetBranch
gh pr create -d -B master -R ${KUBEAPPS_REPO} -F ${PR_INTERNAL_TEMPLATE_FILE} --title "Sync chart with bitnami/kubeapps chart (version $chartVersion)"
else
echo "The remote branch '$targetBranch' already exists, please check if there is already an open PR at the repository '${KUBEAPPS_REPO}'"
fi
cd -
}

0 comments on commit f0b36fc

Please sign in to comment.