Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

job fails if job type is anything other than "GitHub organization" #1

Open
mpavlov opened this issue Oct 6, 2017 · 0 comments
Open

Comments

@mpavlov
Copy link
Contributor

mpavlov commented Oct 6, 2017

Example output:

11:22:36 + ORG_REPO_BRANCH_ARRAY=(${JOB_NAME//// })
11:22:36 + ORG=some_repository_name
11:22:36 + REPO=some_branch_name
11:22:36 + TOKEN_PARAM=access_token=****
...
11:22:36 + echo '{' '"message":' '"Not' 'Found",' '"documentation_url":' '"https://developer.github.com/enterprise/2.8/v3"' '}'
11:22:36 + python -c 'import sys, json
11:22:36 
11:22:36 content = json.load(sys.stdin)
11:22:36 for status in content["statuses"]:
11:22:36     if status["context"] == "code-coverage":
11:22:36         print status["description"].split("%")[0]
11:22:36         sys.exit(0)'
11:22:36 Traceback (most recent call last):
11:22:36   File "<string>", line 4, in <module>
11:22:36 KeyError: 'statuses'

Root cause is parsing of $JOB_NAME into $ORG and $REPO, since $ORG is not present for non-org job types.

Should get the org from somewhere else or at the very minimum not fail the build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant