From 0dbca3b29124ab6a501f1f424651e9b285ee9806 Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Tue, 13 Nov 2018 16:53:02 +0200 Subject: [PATCH 1/4] Update travis-automerge --- travis-automerge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis-automerge b/travis-automerge index c172cbc..9ae1f93 100755 --- a/travis-automerge +++ b/travis-automerge @@ -14,7 +14,7 @@ fi # Since Travis does a partial checkout, we need to get the whole thing repo_temp=$(mktemp -d) -git clone "https://github.com/$GITHUB_REPO" "$repo_temp" +git clone "https://$GITHUB_SECRET_TOKEN@github.com/$GITHUB_REPO" "$repo_temp" # shellcheck disable=SC2164 cd "$repo_temp" From 26c8e2112f5a6841ef21e9116adc61de3f829fd2 Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Tue, 20 Nov 2018 13:46:18 +0200 Subject: [PATCH 2/4] Pushing current branch to avoid it from being deleted --- travis-automerge | 3 +++ 1 file changed, 3 insertions(+) diff --git a/travis-automerge b/travis-automerge index 9ae1f93..e30f49e 100755 --- a/travis-automerge +++ b/travis-automerge @@ -32,3 +32,6 @@ push_uri="https://$GITHUB_SECRET_TOKEN@github.com/$GITHUB_REPO" # Redirect to /dev/null to avoid secret leakage git push "$push_uri" "$BRANCH_TO_MERGE_INTO" >/dev/null 2>&1 git push "$push_uri" :"$TRAVIS_BRANCH" >/dev/null 2>&1 + +# Pushing current branch to avoid from it being deleted (because it was merged) +git push "$push_uri" "$TRAVIS_BRANCH" >/dev/null 2>&1 From dc27c373e3bf96da04f8589c17c53cfa878117dd Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Tue, 20 Nov 2018 13:51:26 +0200 Subject: [PATCH 3/4] Trying to fix bug with pushing current branch --- travis-automerge | 3 --- 1 file changed, 3 deletions(-) diff --git a/travis-automerge b/travis-automerge index e30f49e..1e81b8f 100755 --- a/travis-automerge +++ b/travis-automerge @@ -31,7 +31,4 @@ push_uri="https://$GITHUB_SECRET_TOKEN@github.com/$GITHUB_REPO" # Redirect to /dev/null to avoid secret leakage git push "$push_uri" "$BRANCH_TO_MERGE_INTO" >/dev/null 2>&1 -git push "$push_uri" :"$TRAVIS_BRANCH" >/dev/null 2>&1 - -# Pushing current branch to avoid from it being deleted (because it was merged) git push "$push_uri" "$TRAVIS_BRANCH" >/dev/null 2>&1 From 079b3b1eb805161b365a021d26a9d1b32732467a Mon Sep 17 00:00:00 2001 From: Ron Yishai Date: Tue, 26 Apr 2022 15:14:50 +0300 Subject: [PATCH 4/4] Update travis-automerge --- travis-automerge | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/travis-automerge b/travis-automerge index 1e81b8f..efddd65 100755 --- a/travis-automerge +++ b/travis-automerge @@ -1,7 +1,7 @@ #!/bin/bash -e : "${BRANCHES_TO_MERGE_REGEX?}" "${BRANCH_TO_MERGE_INTO?}" -: "${GITHUB_SECRET_TOKEN?}" "${GITHUB_REPO?}" +: "${GITHUB_REPO?}" export GIT_COMMITTER_EMAIL='travis@travis' export GIT_COMMITTER_NAME='Travis CI' @@ -14,7 +14,7 @@ fi # Since Travis does a partial checkout, we need to get the whole thing repo_temp=$(mktemp -d) -git clone "https://$GITHUB_SECRET_TOKEN@github.com/$GITHUB_REPO" "$repo_temp" +git clone git@github.com:$GITHUB_REPO.git "$repo_temp" # shellcheck disable=SC2164 cd "$repo_temp" @@ -27,7 +27,7 @@ git merge --ff-only "$TRAVIS_COMMIT" printf 'Pushing to %s\n' "$GITHUB_REPO" >&2 -push_uri="https://$GITHUB_SECRET_TOKEN@github.com/$GITHUB_REPO" +push_uri="git@github.com:$GITHUB_REPO.git" # Redirect to /dev/null to avoid secret leakage git push "$push_uri" "$BRANCH_TO_MERGE_INTO" >/dev/null 2>&1