knitr-examples
knitr-examples copied to clipboard
Add a GHA workflow to trigger a new check in knitr repo ?
I think it would be interesting to add a workflow in knitr-example that would trigger a new run of "Check-knitr-example" workflow in knitr repo when we have a new commit to master in this repo.
That way when we push a fix because something changed in knitr we could have the workflow re-run automatically.
Should be possible using
- repository dispatch event : https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch
- Called using API : https://docs.github.com/en/rest/reference/repos#create-a-repository-dispatch-event
- with the help of : https://github.com/actions/github-script or an action that could ease the implementation: https://github.com/peter-evans/repository-dispatch
Instead of adding a new issue I am posting here the idea.
We could also leverage a workflow_dispatch input so that we can run any branch in knitr repo against any branch in this repo using a API call like this
gh workflow run knitr-examples.yaml -f branch=<knitr-example-branch> --ref <knitr-branch>