actions-label-merge-conflict icon indicating copy to clipboard operation
actions-label-merge-conflict copied to clipboard

request changes in PR with merge conflicts

Open eps1lon opened this issue 5 years ago • 5 comments
trafficstars

The ultimate goal is to send notifications to a user. I hoped that adding labels does the trick but it doesn't.

Seems like we have to fallback to comments anyway. I think reviews are a good place for that since they're dismissable. But simple comments might be sufficient (though harder to query).

Initial idea for a query leveraging reviews:

query { 
  repository(owner:"mui-org", name:"material-ui") { 
    pullRequests(states:OPEN,first:100) {
      nodes {
        reviews(author:"eps1lon",states:CHANGES_REQUESTED) {
          nodes {
            id
          }
        }
      }
    }
  }
}

If the PR is mergable dismiss this review. Otherwise add a review requesting changes.

eps1lon avatar Mar 18 '20 13:03 eps1lon

Plain comments work pretty well IMO: https://github.com/pypa/pip/pull/8086#issuecomment-625487715

pradyunsg avatar May 25 '20 11:05 pradyunsg

Plain comments work pretty well IMO: pypa/pip#8086 (comment)

I prefer using PRs for discussion. Comments from bots make the conversation hard to read which is why I try to avoid them as much as possible.

eps1lon avatar May 25 '20 12:05 eps1lon

comments, reviews, labels.... is all a matter of personal preference. I'd rather have an action do one thing instead 10 at the same time and provide me information so I can conditionally chain other actions. Here is a PR that adds the output so people can then chain with additional actions. https://github.com/eps1lon/actions-label-merge-conflict/pull/17

baywet avatar Jul 17 '20 17:07 baywet

Thanks @baywet! Do you have any example of how to actually use the output set by this action to do $things with it?

pradyunsg avatar Aug 28 '20 17:08 pradyunsg

not at hand, it's in a private repo. But you need to give an id to the task (right below the name for example) so you can use the output variable in the following tasks

steps:
    - name: check if prs are dirty
      uses: eps1lon/actions-label-merge-conflict@main
      id: check
    - name: task2
      if: check.prDirtyStatuses[prIdVariable] == true

baywet avatar Aug 28 '20 17:08 baywet