Giter VIP home page Giter VIP logo

Comments (11)

williamboman avatar williamboman commented on June 19, 2024 1

Thos are pretty bad error messages from their API if you ask me 🙈, it had me running in circles. Would you be open for parsing these error messages or even wrapping the entire exception with a custom error message, like:

catch (e) {
  core.error("Unable to enable automerge. Make sure you have enabled branch protection with at least one status check marked as required. See https://github.com/peter-evans/enable-pull-request-automerge#conditions for more information.")
  throw e
}

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on June 19, 2024 1

I would be happy to parse and capture the clean status error, because I think we can be fairly confident about what that means and how it occurs. I would prefer to capture and handle that one specifically, rather than output a custom error message for all exceptions.

from enable-pull-request-automerge.

adrianioana avatar adrianioana commented on June 19, 2024

Hi. @williamboman I am also getting a similar error :(
Error: ["Pull request Pull request is in unstable status"]

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on June 19, 2024

Hi @williamboman

I've not seen this error before. Is it happening consistently, or just occasionally?

My best guess is that it's attempting to enable automerge before it's ready

You could try waiting a few seconds in a workflow step to see if that solves it. Perhaps there is a small delay on GitHub's side before the PR is ready, as you suggest.

from enable-pull-request-automerge.

williamboman avatar williamboman commented on June 19, 2024

What do you think about doing this inside this workflow instead? I feel like it'd be neat if one did not have to worry about these race conditions. I've come up with a somewhat naive approach in #344. Wdyt?

from enable-pull-request-automerge.

williamboman avatar williamboman commented on June 19, 2024

So I actually debugged this a bit closer and I don't believe this is happening because of some race condition, there has to be something else going on. I added a retry mechanism that sleeps for 30s before retrying, but it's still consistently failing with the same error, even if the PR checks are all registered and even completed.

from enable-pull-request-automerge.

williamboman avatar williamboman commented on June 19, 2024

I think I know what it might've been. I had not made any checks explicitly required under the repo settings - I had only enabled the checkbox itself. If you don't manually add specific checks that are required I believe GitHub's native automerge feature simply doesn't apply

Screenshot 2022-06-16 at 01 42 51

"

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on June 19, 2024

Ah, yes. You must have at least one required check set.

It's mentioned in the "conditions" section here.
https://github.com/peter-evans/enable-pull-request-automerge#conditions

The clean status error makes sense now. The pull request had no pending checks and was already able to be merged. I think this error message is new, because when I was developing the action and testing it I never saw that message. Previously, I think it just failed silently.

from enable-pull-request-automerge.

williamboman avatar williamboman commented on June 19, 2024

Cool! I went ahead and implemented it in #345! Not sure if you want logging in the helper module, but that's where I'd put it.

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on June 19, 2024

Merged and released. Thanks!

I think we can consider this closed. If other error messages emerge we can handle those separately.

from enable-pull-request-automerge.

Haegi avatar Haegi commented on June 19, 2024

Hi all,

I am facing this issue. Even with all conditions met.
It works when using it in a simple github action but in a composite action it fails with:

Error: Unable to enable automerge. Make sure you have enabled branch protection with at least one status check marked as required. See https://github.com/peter-evans/enable-pull-request-automerge#conditions for more information.
Error: Request failed due to following response errors:
 - ["Pull request Pull request is in clean status"]

Maybe it is also related to the fact that the composite action is located in the same repo, where it should open a PR but still it is kind of confusing.

Do you maybe have a an idea?

Quick update: The Pull request was opened against some branch, which did not have any branch protection. It works now.

from enable-pull-request-automerge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.