We want to pick out the Author of a build since Creator is only correct if the author has a Buildkite user.
field.
Here is a sample event that Buildkite sends copied (and censored) from the Builkite Webhook Notification page:
{
"event": "build.finished",
"build": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"graphql_id": "xxxxxxxxxxxxxxxxxxxxxxxxxx=",
"number": 20125,
"state": "passed",
"blocked": false,
"blocked_state": "",
"message": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"commit": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"branch": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"tag": null,
"source": "api",
"author": {
"name": "n.n",
"email": "[email protected]"
},
"creator": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"graphql_id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"name": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"email": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"avatar_url": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"created_at": "2019-12-16T14:11:42.986Z"
},
"created_at": "2021-03-23T13:21:52.185Z",
"scheduled_at": "2021-03-23T13:21:52.109Z",
"started_at": "2021-03-23T13:22:00.000Z",
"finished_at": "2021-03-23T13:56:55.000Z",
"meta_data": {
"ci": "True",
"change": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"message": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"fullbuild": "True",
"is_tryjob": "true",
},
"pull_request": null,
"rebuilt_from": null
},
"pipeline": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"graphql_id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"url": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"web_url": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"name": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"description": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"slug": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"repository": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"cluster_id": null,
"branch_configuration": "",
"default_branch": "pioneer",
"skip_queued_branch_builds": false,
"skip_queued_branch_builds_filter": null,
"cancel_running_branch_builds": false,
"cancel_running_branch_builds_filter": null,
"allow_rebuilds": true,
"provider": {
"id": "github",
"settings": {
"trigger_mode": "none",
"build_pull_requests": true,
"pull_request_branch_filter_enabled": false,
"skip_builds_for_existing_commits": false,
"skip_pull_request_builds_for_existing_commits": true,
"build_pull_request_forks": false,
"build_pull_request_ready_for_review": false,
"prefix_pull_request_fork_branch_names": true,
"build_tags": false,
"publish_commit_status": false,
"publish_commit_status_per_step": false,
"separate_pull_request_statuses": false,
"publish_blocked_as_pending": false,
"filter_enabled": false,
"repository": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"pull_request_branch_filter_configuration": ""
},
"webhook_url": "xxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"builds_url": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"badge_url": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"created_by": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"graphql_id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"name": "M M",
"email": "[email protected]",
"avatar_url": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"created_at": "2019-09-03T08:24:46.059Z"
},
"created_at": "2019-10-03T07:12:15.505Z",
"archived_at": null,
"env": null,
"scheduled_builds_count": 0,
"running_builds_count": 13,
"scheduled_jobs_count": 3,
"running_jobs_count": 28,
"waiting_jobs_count": 7,
"visibility": "private",
"configuration": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"steps": [
{
"type": "script",
"name": ":pipeline:",
"command": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"artifact_paths": null,
"branch_configuration": null,
"env": {
},
"timeout_in_minutes": null,
"agent_query_rules": [
"queue=ue4-ci-enqueue"
],
"concurrency": null,
"parallelism": null
}
]
},
"sender": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"name": "xxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}