Skip to content

Commit

Permalink
ci: Add Pull request check to semaphore scripts
Browse files Browse the repository at this point in the history
This fixes the conditions of build failure when someone created a
pull request from the master branch. It now also checks if it is a
Pull request or not.

Fixes coala#583
  • Loading branch information
Man-Jain committed Oct 14, 2018
1 parent aed83ca commit 29d2031
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .ci/semaphore.answers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pull_and_build() {
docker build -t meetmangukiya/corobo-answers answers/
}

if [[ $BRANCH_NAME != "master" ]]
if [[ $BRANCH_NAME != "master" && -n $PULL_REQUEST_NUMBER ]]
then
.ci/check_docker.py
if [[ $? == 1 ]]
Expand Down
2 changes: 1 addition & 1 deletion .ci/semaphore.docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ docker run --user root meetmangukiya/corobo /bin/sh -c "
python -m pytest
"

if [[ $BRANCH_NAME == "master" ]]
if [[ $BRANCH_NAME == "master" && -z $PULL_REQUEST_NUMBER ]]
then echo "pushing..." && docker push meetmangukiya/corobo && docker push meetmangukiya/corobo-answers
fi

0 comments on commit 29d2031

Please sign in to comment.