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

Action fails when no diff between branches #56

Closed
DavideViolante opened this issue Dec 11, 2020 · 11 comments
Closed

Action fails when no diff between branches #56

DavideViolante opened this issue Dec 11, 2020 · 11 comments

Comments

@DavideViolante
Copy link

It's normal that the action fails when there are no differences between the branches?
I'd expect a fail when the action should actually open the PR, but it doesn't.

The error I get is

Unable to create pull request: 422: Unprocessable Entity, Validation Failed

That is not much clear about the reason of the failure.

@vsoch
Copy link
Owner

vsoch commented Dec 11, 2020

This actually happened to me recently because I was trying to open a PR for a branch that didn't exist, and you're right, the message is a bit cryptic. Let me take a look and see if I can make it more verbose.

@vsoch
Copy link
Owner

vsoch commented Dec 11, 2020

okay, I have a branch for you to test!

#57

If you can reproduce the issue above, that would be great! See the description in the PR for an explanation of changes. And let me know if/when it works, and show me a screenshot / link to the action to confirm.

@DavideViolante
Copy link
Author

Just tested it:
vsochautopr

The action still fails, but with a better message.
How can I make it pass in this case?

@vsoch
Copy link
Owner

vsoch commented Dec 12, 2020

You don’t have any changed commits, so there is nothing to PR. You’d want to checkout a new branch, make changes, push, then use the action.

@vsoch
Copy link
Owner

vsoch commented Dec 12, 2020

@DavideViolante if you get a chance, could you please review / approve the PR so that the default has this improved verbosity?

@DavideViolante
Copy link
Author

You don’t have any changed commits, so there is nothing to PR. You’d want to checkout a new branch, make changes, push, then use the action.

I know... but I'd expect that the action would not fail in this case. The action executed correctly, it checked that no PR is needed, and it finishes.
I run this on a cron basis, such as every monday. If there are no diff between 2 branches, I expect no PR, and no fail from the action (it worked correctly).

@vsoch
Copy link
Owner

vsoch commented Dec 12, 2020

Ah I see, then I think you would want to set PASS_ON_ERROR (see the README).

@DavideViolante
Copy link
Author

DavideViolante commented Dec 18, 2020

Yeah it would be a solution, but I think by default, if the PR should not be created coz there are no diff, or coz it's already opened, there should be no fail for the action.

Thanks anyway, it's just my opinion, there is no right solution, it more UX perception than a bug.

ps the PR is ok, better then before for sure.

@vsoch
Copy link
Owner

vsoch commented Dec 19, 2020

hey @DavideViolante sorry I gave you the wrong environment variable! You can set PASS_IF_EXISTS to get the specific functionality you are looking for. It's not the default because different users would have different preferences. Hope that helps!

@steven-prybylynskyi
Copy link

PASS_IF_EXISTS is:

Instead of failing if the pull request already exists, pass

For this situation a new variable is needed, e.g. PASS_IF_NO_DIFF

@vsoch
Copy link
Owner

vsoch commented Jan 4, 2023

Yep would be open to a PR to add this, if desired.

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

3 participants