Relay Jenkins events to Github Action workflows#289
Conversation
These changes are meant to allow us to write GitHub Actions in selected
repositories in the nodejs github organization, as a reaction to
Jenkins events.
It works by dispatching repository events, which we can use as triggers
for GitHub Action workflows.
Here's a concrete repository dispatch event caused by the Jenkins job
`node-test-commit-osx`:
```
event_type: jenkins.node-test-commit-osx.start or jenkins.node-test-commit-osx.end
client_payload:
{
"identifier": "node-test-commit-osx",
"status": "success",
"message": "tests passed",
"commit": "8a5fec2a6bade91e544a30314d7cf21f8a200de1",
"url": "https://ci.nodejs.org/job/node-test-commit/3157/",
"ref": "refs/pull/12345/head"
}
```
Refs:
- https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
- https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#create-a-repository-dispatch-event
|
Thanks for having a look @mmarchini! Since you know the practical use cases better than me, I'd love your feedback on the following ramblings... On second thought, I've got some doubts with regards to the event type names suggested with these changes. Especially having the job names, like Trying to put myself in the using end of these dispatched events, I get concerned they'll end up being awkward to consume: on:
repository_dispatch:
types: [ jenkins.node-test-commit-osx.start, jenkins.node-test-linter.start, jenkins.node-test-pull-request.start ] # ..and the list goes onWould it make sense to use on:
repository_dispatch:
types: [ jenkins.job.start ]and then filter on |
|
Oh, I didn't include one of my ideas in the PR. We could have wildcards: |
|
Ahhh alrighty then, let's go with this as is. |
|
It's alive. {
"name": "bot",
"hostname": "infra-rackspace-debian8-x64-1",
"pid": 27894,
"req_id": "a66d6390-38cd-11eb-a22b-f5ad452d226c",
"identifier": "node-test-commit-aix",
"event": "end",
"level": 20,
"msg": "Relaying jenkins.node-test-commit-aix.end to nodejs/node",
"time": "2020-12-07T20:49:07.658Z",
"v": 0
} |
These changes are meant to allow us to write GitHub Actions in selected repositories in the nodejs github organization, as a reaction to Jenkins events.
It works by dispatching repository events, which we can use as triggers for GitHub Action workflows.
Here's a concrete repository dispatch event caused by the Jenkins job
node-test-commit-osx:Refs: