File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import hashlib
66import json
77import os
8+ import sys
89import subprocess
910import time
1011from collections import OrderedDict
2122
2223GITHUB_USERNAME = os .environ .get ('MACHINE_USER' )
2324GITHUB_PASSWORD = os .environ .get ("MACHINE_PASSWORD" , os .environ .get ("GH_TOKEN" ))
25+ ACTIVE_PACK_NAME = os .environ .get ('PACK_NAME' , "unknown" )
2426
2527SESSION = requests .Session ()
2628SESSION .auth = (GITHUB_USERNAME , GITHUB_PASSWORD )
@@ -149,6 +151,13 @@ def get_available_versions():
149151 proc .kill ()
150152 outs , _ = proc .communicate ()
151153 result = outs .decode ().strip ()
154+ if proc .returncode != 0 :
155+ sys .exit (
156+ "Error retrieving data with github graphql API.\n "
157+ "The Github PAT might need to be regenerated:\n "
158+ "https://github.com/settings/tokens/new?scopes=public_repo"
159+ "&description=CircleCI%3A%20stackstorm-" + ACTIVE_PACK_NAME
160+ )
152161
153162 # https://stackoverflow.com/a/43807246/1134951
154163 decoder = json .JSONDecoder ()
You can’t perform that action at this time.
0 commit comments