diff --git a/travis/pr-check-base.py b/travis/pr-check-base.py index e4e9ae910..e31e33bcf 100644 --- a/travis/pr-check-base.py +++ b/travis/pr-check-base.py @@ -5,14 +5,18 @@ else: from urllib.request import urlopen from urllib.error import HTTPError try: + repo = os.environ.get('TRAVIS_REPO_SLUG', 'dfhack/dfhack').lower() pr_id = int(os.environ.get('TRAVIS_PULL_REQUEST', 'false')) except ValueError: print('Not a pull request') sys.exit(0) -print('Pull request %i' % pr_id) +print('Pull request %s#%i' % (repo, pr_id)) +if repo != 'dfhack/dfhack': + print('Not in dfhack/dfhack') + sys.exit(0) res = {} try: - res = json.loads(urlopen('https://api.github.com/repos/dfhack/dfhack/pulls/%i' % pr_id).read().decode('utf-8')) + res = json.loads(urlopen('https://api.github.com/repos/%s/pulls/%i' % (repo, pr_id)).read().decode('utf-8')) except ValueError: pass except HTTPError: