knl / niv-updater-action

A GitHub Action that creates meaningful pull requests with updates to your niv-managed dependencies, so you don't have to do menial chores.
BSD 3-Clause "New" or "Revised" License
28 stars 11 forks source link

Two push events are triggered #61

Open jfroche opened 1 year ago

jfroche commented 1 year ago

Whenever niv-updater-action needs to create a new branch, it triggers two different push events, one for the branch creation, another for the commit containing the actual niv dependencies update. We are using github actions on our repositories. Having two events means github actions are triggered once for the branch (copy of the base branch) and a second time for the commit. We tried to use concurency to cancel the first run but it randomly cancel the right one.

Would it be an option to use the git client to push the created the branch and the commit at once ?

knl commented 1 year ago

Hi @jfroche thanks for reporting this issue. I think I initially implemented it this way to that one doesn't have to have a checkout of the code. I'll try to implement it over the weekend by either using the API to achieve the same, or have an option to use git executable (if one already has checked out the code).