I can trigger a workflow based on a push to my repo with
on:
push
Is it possible to trigger a workflow when there is a push to another public repo that I don’t have push access to, such as phpmyadmin?
I can trigger a workflow based on a push to my repo with
on:
push
Is it possible to trigger a workflow when there is a push to another public repo that I don’t have push access to, such as phpmyadmin?
3
Answers
I’m pretty sure the answer is no, you can’t programmatically subscribe one repo to another repo’s events.
However what you could do is run a scheduled job (once per day, or more frequently if you need) to check for any updates. You could store the last known SHA in your repo, then update it via a PR or direct commit when the action detects an update.
This is similar to what tools like https://dependabot.com/ do.
You can use “Repository_dispatch” trigger to trigger any workflow. The link below can be helpful to use
With that payload, you can POST the request to https://api.github.com/repos/:owner/:repo/dispatches to trigger workflows
Let me know if this helps you out.
This may be not helpful if you don’t have access to both repositories, but since I haven’t found any other solution I post it anyway.
The solution can happen on push or any other event and it’s using this dispatch github action:
then listen to the event_type from the subscribed repository: