Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable merge conflict message #101

Open
marcoadkins opened this issue Jan 13, 2021 · 7 comments
Open

Configurable merge conflict message #101

marcoadkins opened this issue Jan 13, 2021 · 7 comments

Comments

@marcoadkins
Copy link

Thoughts on adding a configuration value to support custom merge conflict messages similar to the existing MERGE_MSG setting?

@chinthakagodawita
Copy link
Owner

Hey @marcoadkins - where would this message be displayed? In the log or as a comment in the PR?

MERGE_MSG is a little different as it controls the commit message. autoupdate makes no changes to the branch if it detects a conflict since conflicts require a manual resolution.

@marcoadkins
Copy link
Author

@chinthakagodawita I was thinking as a comment on the PR. To alert authors that they have a conflict to resolve.

@chinthakagodawita
Copy link
Owner

Yep, that's definitely on the cards (see #11). I can't promise an ETA just yet though but happy to accept PRs if you feel like giving it a crack 🙂

@marcoadkins
Copy link
Author

I see. I started working on this a day or so ago. It's a little more specific to my use case but could easily pull out the jira logic and just leave the commenting strategy there. So maybe once I am done with what I need I will go back and PR just the comment side.

master...marcoadkins:master

@chinthakagodawita
Copy link
Owner

Oh nice one, looking forward to it!

@marcoadkins
Copy link
Author

marcoadkins commented Jan 20, 2021

@chinthakagodawita Hit a bit of a snag with the issue comment feature. Ended up spamming our repos every time a push happened after a conflict existed. So need to identify a reliable way to prevent duplicate comments on the same conflict. I am thinking either a label that gets added/removed when conflicts arise/subside, or fetch the issue comments and compare the git hash they were added on if thats possible...

@chinthakagodawita
Copy link
Owner

Yea I was worried about that.

One option is to include a hidden HTML tag in the comment, load existing comments, check if any of them have that hidden tag and leave a conflict message comment if not.

Here's an example of another GH action that does that: https://github.com/marocchino/sticky-pull-request-comment/blob/17dbcbf6a4e62aa43b811fc51f40c4f5b1445f78/src/comment.ts#L7

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

No branches or pull requests

2 participants