cirrus-actions / rebase

GitHub Action to automatically rebase PRs
MIT License
686 stars 138 forks source link

Allow PR_NUMBER to be set externally #76

Closed pezholio closed 3 years ago

pezholio commented 3 years ago

I've put together an action that rebases a number of PRs in one go, and we would find it useful to be able to specify the PR_NUMBER externally. I've also added some initial documentation.

fkorotkov commented 3 years ago

Hey @pezholio, could you please elaborate on your use case? Why are you specifying the PR explicitly in the YAML and not just commenting on the corresponding PRs?

pezholio commented 3 years ago

@fkorotkov So, in my case, if we have a lot of open PRs (such as from Dependabot, for example), there's a constant round of merging one PR, then rebasing the next PR, then merging, then rebasing. I've added an action that, on merge to master/develop, we cycle through all open PRs that are set to auto merge, then loop through them and rebase i.e.

https://github.com/UKGovernmentBEIS/beis-report-official-development-assistance/blob/75b46f8cc33ed73ac628793b13128aa4d3ac3dff/.github/workflows/trigger_rebase.yml

fkorotkov commented 3 years ago

Oh! You are using output of one action to generate a matrix of actions for each PR to be rebased on. I see.

Seems a bit costly if you rebase all PRs for each PR. I think you can only rebase the oldest open PR ready to auto-merge to reduce the amount of rebase actions from n*(n-1)/2 to just n where n is the amount of PRs ready to auto-merge.

pezholio commented 3 years ago

Cool, thanks for the merge and the tips! 👍