When I create a new release on Github via its UI, I want to trigger the release.yml workflow.
Within the release.yml workflow, I'd like to first run the ci.yml workflow and only if it passes, go ahead and create a release. If the ci.yml worflow fails, remove the newly created release on the Github UI as well.
I have 2 YAML files ci.yml and release.yml
In my release.yml file
on:
release:
types: [created]
jobs:
# I want to run the ci.yml workflow here and then run the jobs below if it passes.
# If the ci.yml workflow fails, revert back and remove the created release.
job1:
.........
job2:
.........
If there is a better way to do achieve this, please let me know.