mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-11 03:57:01 +00:00
Add Repository information to Runner Status (#2093)
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
This commit is contained in:
@@ -15,9 +15,30 @@ if [[ ${RUNNER_STATUS_UPDATE_HOOK:-false} == true ]]; then
|
||||
namespace=$(cat ${serviceaccount}/namespace)
|
||||
token=$(cat ${serviceaccount}/token)
|
||||
phase=$1
|
||||
shift
|
||||
message=${2:-}
|
||||
|
||||
jq -n --arg phase "$phase" --arg message "${*:-}" '.status.phase = $phase | .status.message = $message' | curl \
|
||||
data=$(jq -n --arg phase "$phase" \
|
||||
--arg message "$message" \
|
||||
--arg workflow_repository "${GITHUB_REPOSITORY:-}" \
|
||||
--arg workflow_repository_owner "${GITHUB_REPOSITORY_OWNER:-}" \
|
||||
--arg workflow_name "${GITHUB_WORKFLOW:-}" \
|
||||
--arg workflow_run_id "${GITHUB_RUN_ID:-}" \
|
||||
--arg workflow_run_number "${GITHUB_RUN_NUMBER:-}" \
|
||||
--arg workflow_job "${GITHUB_JOB:-}" \
|
||||
--arg workflow_action "${GITHUB_ACTION:-}" \
|
||||
'
|
||||
.status.phase = $phase
|
||||
| .status.message = $message
|
||||
| .status.workflow.name = $workflow_name
|
||||
| .status.workflow.runID = $workflow_run_id
|
||||
| .status.workflow.runNumber = $workflow_run_number
|
||||
| .status.workflow.repository = $workflow_repository
|
||||
| .status.workflow.repositoryOwner = $workflow_repository_owner
|
||||
| .status.workflow.job = $workflow_job
|
||||
| .status.workflow.action = $workflow_action
|
||||
')
|
||||
|
||||
echo "$data" | curl \
|
||||
--cacert ${serviceaccount}/ca.crt \
|
||||
--data @- \
|
||||
--noproxy '*' \
|
||||
|
||||
Reference in New Issue
Block a user