Closed pmbarrett314 closed 1 year ago
Would love to do this. Need to find time to dig into it.
I'll make some PRs as I understand the process.
What you'd need to do (other than merge the PRs) is
Feel free to check my work, here's some docs I referenced
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_dispatch
No worries if you want to dig into it yourself and make sure everything is right, it's an extremely minor inconvenience.
This is great! And hugely appreciated.
(I'll merge the ruff
side of this in a bit.)
I just cut v0.0.224, and it looks like the trigger didn't run. It does seem like it POSTed without issue from the ruff
side (https://github.com/charliermarsh/ruff/actions/runs/3936152413/jobs/6732625209).
Oops, I think when I was making my PRs I accidentally made the event names inconsistent.
So either ruff.yaml:298 in ruff needs to end with --data '{"event_type": "pypi_release"}'
Or main.yaml:7 in this repo needs to say types: [build_pypi_release]
Not sure how that one slipped by me.
Ahhh right. Ok. Will fix in the morning, thanks!
👍 It did, but I think I need to add some sort of timeout or wait, as that run didn't actually pick up the new release (it takes a second to propagate to PyPI and presumedly work through caches).
Hmm, that makes sense. The hard but correctish way to do it would probably be something like polling pypi until the new version shows up. The easiest thing to do would probably be just inserting 30 seconds of sleep in the workflow 😂.
Yeah I think a sleep is the move :)
It would be helpful if the mirror workflow triggered automatically when a new version was pushed to pypi rather than every 4 hours. Specifically I'm running ruff itself via a github action, but also locally via pre-commit, so if I try to push during those 4 hours it can break my workflows.
This github community thread looks like a solution.