https://github.com/horothesun/github-actions-from-jenkins
Trigger and wait for a GitHub Action workflow from a Jenkins pipeline.
https://github.com/horothesun/github-actions-from-jenkins
github-action github-actions github-actions-ci groovy groovy-language jcasc jenkins jenkins-configuration-as-code jenkins-declarative jenkins-pipeline polling
Last synced: about 1 year ago
JSON representation
Trigger and wait for a GitHub Action workflow from a Jenkins pipeline.
- Host: GitHub
- URL: https://github.com/horothesun/github-actions-from-jenkins
- Owner: horothesun
- Created: 2021-08-29T12:54:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-28T16:25:58.000Z (about 4 years ago)
- Last Synced: 2025-01-04T15:30:11.226Z (about 1 year ago)
- Topics: github-action, github-actions, github-actions-ci, groovy, groovy-language, jcasc, jenkins, jenkins-configuration-as-code, jenkins-declarative, jenkins-pipeline, polling
- Language: Groovy
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Actions from Jenkins
[](https://github.com/horothesun/github-actions-from-jenkins/actions/workflows/my_action.yml)
[](https://github.com/horothesun/github-actions-from-jenkins/actions/workflows/my_failing_action.yml)
Trigger and wait for a GitHub Action workflow from a Jenkins pipeline.
## Details
Given the [API to trigger a GitHub Action](https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event) doesn't return any identifier, the strategy adopted here is to generate a UUID from Jenkins, passing it to a standardised `inputs.trigger_id` field to the newly triggered GitHub Action.
The identifier is going to be used as a _workflow artifact name_, which will then be used to identify the _actual workflow run_ from Jenkins.
This will enable Jenkins to wait for the specific workflow run completion.