Skip to content

Commit

Permalink
Delete branch after push
Browse files Browse the repository at this point in the history
  • Loading branch information
cdown committed Sep 27, 2015
1 parent 3f68cf0 commit 3193203
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions travis-automerge
Expand Up @@ -20,13 +20,15 @@ git clone "https://github.com/$GITHUB_REPO" "$repo_temp"
cd "$repo_temp"

printf 'Checking out %s\n' "$BRANCH_TO_MERGE_INTO" >&2

git checkout "$BRANCH_TO_MERGE_INTO"

printf 'Merging %s\n' "$TRAVIS_COMMIT" >&2
git merge --ff-only "$TRAVIS_COMMIT"

printf 'Pushing to %s\n' "$GITHUB_REPO" >&2

push_uri="https://$GITHUB_SECRET_TOKEN@github.com/$GITHUB_REPO"

# Redirect to /dev/null to avoid secret leakage
git push "https://$GITHUB_SECRET_TOKEN@github.com/$GITHUB_REPO" \
"$BRANCH_TO_MERGE_INTO" >/dev/null 2>&1
git push "$push_uri" "$BRANCH_TO_MERGE_INTO" >/dev/null 2>&1
git push "$push_uri" :"$TRAVIS_BRANCH" >/dev/null 2>&1

2 comments on commit 3193203

@emmekappa
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that deleting the branch should be an option.

@Giymo11
Copy link

@Giymo11 Giymo11 commented on 3193203 Feb 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. A quick fix @emmekappa is to just use the file before this commit for your travis to download.

Please sign in to comment.