Another frequently-requested feature for Actions is a way to trigger one workflow based on the completion of another workflow. For example, you may want to take the results of a CI workflow and run some further analysis.
The new workflow_run event enables you to trigger a new workflow when one or more workflows are requested or completed. Runs triggered by the workflow_run event always use the default branch for the repository, and have access to a read/write token as well as secrets. As an example, as a maintainer you could set up a workflow that takes the artifacts generated by the pull request workflow, do some analysis, and post comments back to the pull request. This event is also available as a webhook and works all repos.
This is quoted from Github's blog.
Could anybody tell me how to implement the example proposed using the new event workflow_run
? The documentation only provide a very simple example:
on:
workflow_run:
workflows: ["Run Tests"]
branches: [main]
types:
- completed
- requested
I would be very glad if someone can teach me how to achieve the example.