workflow-dispatch
workflow-dispatch copied to clipboard
Dispatch multiple workflows in one actions
I need to trigger at least 4 parallel workflows after one particular workflow has finished. I think this action's syntax could be extended to something like this:
name: Workflow dispatch
uses: benc-uk/workflow-dispatch@v1
with:
workflow:
- unit
- integration
- ui
- perf
token: ${{ secrets.TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}`
This would be more cleaner way to describe such use case.
Good suggestion, I think I can add this to minor version without breaking the existing behaviour
I've had a similar need and I've accomplished this using the built in strategy.matrix:
strategy:
fail-fast: false
matrix:
workflow: [ 'First workflow', 'Second workflow' ]
branch: [ 'branch1', 'branch2' ]
Your step would look like this:
- name: Dispatch workflow run
uses: benc-uk/workflow-dispatch@v1
with:
workflow: ${{ matrix.workflow }}
token: ${{ secrets.MYTOKEN }}
ref: ${{ matrix.branch }}
This will dispatch each workflow for each of the defined branches. The fail-fast is important in case there is an issue with one of the dispatch events. It would allow the others to complete.
Given the time I have to maintain this action, I won't be looking at this. Sorry