2015-10-30 20:58:58 -06:00
|
|
|
import os, sys
|
|
|
|
repo = os.environ.get('TRAVIS_REPO_SLUG', 'dfhack/dfhack').lower()
|
|
|
|
branch = os.environ.get('TRAVIS_BRANCH', 'master')
|
2015-02-15 11:23:39 -07:00
|
|
|
try:
|
|
|
|
pr_id = int(os.environ.get('TRAVIS_PULL_REQUEST', 'false'))
|
|
|
|
except ValueError:
|
|
|
|
print('Not a pull request')
|
|
|
|
sys.exit(0)
|
2015-06-14 09:54:25 -06:00
|
|
|
print('Pull request %s#%i' % (repo, pr_id))
|
|
|
|
if repo != 'dfhack/dfhack':
|
|
|
|
print('Not in dfhack/dfhack')
|
|
|
|
sys.exit(0)
|
2015-10-30 20:58:58 -06:00
|
|
|
if branch != 'develop':
|
2015-02-15 11:23:39 -07:00
|
|
|
print('Not based on develop branch')
|
|
|
|
sys.exit(1)
|
|
|
|
else:
|
|
|
|
print('Ok')
|
|
|
|
sys.exit(0)
|