@@ -51,21 +51,25 @@ def handler(event):
5151 - Starts a runner
5252 '''
5353
54+ event_input = event .get ('input' )
55+
5456 # Get PAT
55- if event .get ('github_pat' , None ) is not None :
56- pat = event .get ('github_pat' )
57- event .pop ('github_pat' , None )
57+ if event_input .get ('github_pat' , None ) is not None :
58+ pat = event_input .get ('github_pat' )
59+ event_input .pop ('github_pat' , None )
5860 elif os .environ .get ("GITHUB_PAT" , None ) is not None :
5961 pat = os .environ .get ("GITHUB_PAT" )
6062 else :
6163 raise Exception ("Missing GitHub Personal Access Token" )
6264
6365 # Get ORG
64- if event .get ('github_org' , None ) is not None :
65- org = event .get ('github_org' )
66- event .pop ('github_org' , None )
66+ if event_input .get ('github_org' , None ) is not None :
67+ org = event_input .get ('github_org' )
68+ event_input .pop ('github_org' , None )
6769 elif os .environ .get ("GITHUB_ORG" , None ) is not None :
6870 org = os .environ .get ("GITHUB_ORG" )
71+ else :
72+ raise Exception ("Missing GitHub Organization" )
6973
7074 # Configure runner
7175 config_cmd = f'./actions-runner/config.sh --url https://github.com/{ org } --token { get_token (pat , org )} --name { RUNNER_NAME } --work _work --labels runpod'
@@ -79,7 +83,7 @@ def handler(event):
7983 for var in unwated_env_vars :
8084 runner_env .pop (var , None )
8185
82- runner_env ['JOB_INPUT' ] = str (event [ 'input' ] )
86+ runner_env ['JOB_INPUT' ] = str (event_input )
8387
8488 # Start runner
8589 start_cmd = './actions-runner/run.sh --once'
0 commit comments