An AWS function that checks whether recieved check_run is allowed to run and tells runner admin what to do in the log.
To setup you need
- a repo with a Self hosted runner registered, but offline
- a AWS profile called
serverless
to use for deploying the AWS Lambda function, use ./policy.json as the policy for the user. - node.js
npx serverless deploy
It should output a endpoint URL.
In GH repo settings create a new web hook.
- Use endpoint URL from deploy as Payload URL
- Use content type
application/json
- Select only
Check runs
event
Make change to repo to trigger a check_run webhook.
In AWS console go to log events of the check_run
Lambda function and follow instructions that appear in the log. The log message should tell you to start/stop runner or cancel workflow.
Remove webhook in GitHub
Remove AWS function with
npx serverless remove