Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Suggestion: Trigger rebase using labels #53

Open
matthijskooijman opened this issue May 27, 2020 · 5 comments
Open

Suggestion: Trigger rebase using labels #53

matthijskooijman opened this issue May 27, 2020 · 5 comments

Comments

@matthijskooijman
Copy link

To reduce the noise on a PR from a /rebase comment, it might be interesting to let the rebase be triggered by a label. E.g.:

  • You add a "needs-rebase" label to the PR
  • This triggers the rebase action
  • After rebasing, the label is removed by the action

I suspect that this might not actually need any changes to the action itself, just a different workflow configuration (this would require a way to remove a label, but it seems there is an action for that, or it could be done using github-script).

Anyone tried this already?

@fkorotkov
Copy link
Member

I think in theory this should work:

on: 
  issue:
    types: [labeled]
name: Automatic Rebase
jobs:
  rebase:
    name: Rebase
    if: github.event.issue.pull_request != '' && github.event.label == 'needs_rebase'
    # the rest is the same

@Paulomart
Copy link
Contributor

Did some tests using labels: Paulomart/rebase-test#2
The actions runs when the label is set and removes it when the action is run.

Problem here is that, the pull_request event is not trigged when the pr has conflicts.

@matthijskooijman
Copy link
Author

Problem here is that, the pull_request event is not trigged when the pr has conflicts.

Hm, that sounds weird. Is that documented? Or is this a bug in GH?

@Paulomart
Copy link
Contributor

Yeah there is an answer in the support forum https://github.community/t/run-actions-on-pull-requests-with-merge-conflicts/17104/2

@matthijskooijman
Copy link
Author

Might be good to send in feedback to GH as suggested in the last post, in case nobody did so already (and otherwise to give the issue a bit more priority). Also, consider tracking your feedback at https://github.com/isaacs/github/issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants