Giter VIP home page Giter VIP logo

Comments (15)

izavads avatar izavads commented on July 18, 2024 1

@Celebrate-Reinhard
i did not split the automerge part to be in a seperated yml workflow
the checks and the automerge is in the same yml in my case
try to check it at the same way , also verify that atleast one check that you are running is required ( you can set it to be required in the protected branch rule ) .

i also made sure that the automerge job runs first

`
jobs:

AutoMerge_PRClose:
runs-on: preProdCi

timeout-minutes: 30
steps:
  - uses: actions-ecosystem/action-add-labels@v1
    with:
      labels: automerge
  - uses: peter-evans/enable-pull-request-automerge@v2
    with:
      token: ${{ secrets.MERGE_SECRET }}
      pull-request-number: ${{github.event.pull_request.number}}
      merge-method: squash

create_virtual_environment:
runs-on: preProdCi
needs: [ AutoMerge_PRClose ]
`

from enable-pull-request-automerge.

Celebrate-Reinhard avatar Celebrate-Reinhard commented on July 18, 2024 1

Thank you, @izavads!

also verify that atleast one check that you are running is required ( you can set it to be required in the protected branch rule ) .

This is exactly what I missed!

i did not split the automerge part to be in a seperated yml workflow

I also reverted my split and it's now again like desribed yesterday.

Details for everyone with the same issue like me.

This is how it should look like:
grafik

I just had to define the CI jobs as "required before merging"
grafik

Before, the CI jobs ran and they even could fail, but they were not required. So the PR was always in a merge ready state from the very beginning. And being in that state the auto-merge flag cannot be set; not by UI and not by @peter-evans 's action.

from enable-pull-request-automerge.

williamboman avatar williamboman commented on July 18, 2024 1

I think this error should be caught and display a more helpful error message, basically extending the error message matching that was done in #345, I'll open a PR

from enable-pull-request-automerge.

novotl avatar novotl commented on July 18, 2024

👍 We're observing the same issue

from enable-pull-request-automerge.

Celebrate-Reinhard avatar Celebrate-Reinhard commented on July 18, 2024

same error here

some of my config details...

- name: Create Pull Request
  id: stepIdCpr
  uses: peter-evans/create-pull-request@v4
  with:
    branch: acceptance-promotion
    token: ${{ secrets.... }}
- name: Enable Pull Request Automerge
  if: steps.stepIdCpr.outputs.pull-request-operation == 'created'
  uses: peter-evans/enable-pull-request-automerge@v2
  with:
    token: ${{ secrets.... }}
    pull-request-number: ${{ steps.stepIdCpr.outputs.pull-request-number }}
    merge-method: merge

...and debug output that might help investigating the issue:

##[debug]Evaluating condition for step: 'Enable Pull Request Automerge'
##[debug]Evaluating: (success() && (steps.stepIdCpr.outputs.pull-request-operation == 'created'))
...
##[debug]......Evaluating String:
##[debug]......=> 'pull-request-operation'
##[debug]....=> 'created'
...
##[debug]Expanded: (true && ('created' == 'created'))
##[debug]Result: true
##[debug]Starting: Enable Pull Request Automerge
##[debug]Loading inputs
##[debug]Evaluating: secrets....
...
##[debug]Evaluating: steps.stepIdCpr.outputs.pull-request-number
...
##[debug]Result: '42'
##[debug]Evaluating: github.repository
...
##[debug]Loading env
Run peter-evans/enable-pull-request-automerge@v2
...
Fetching pull request ID
##[debug]PullRequestId: 'PR_...
Enabling auto-merge on pull request ID PR_...
Error: Request failed due to following response errors:
 - ["Pull request Pull request is in unstable status"]
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Enable Pull Request Automerge

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on July 18, 2024

Since you all seemed to experience this at the same time, it's likely that it's an issue on GitHub's side. The action itself has not changed in any way.

from enable-pull-request-automerge.

Celebrate-Reinhard avatar Celebrate-Reinhard commented on July 18, 2024

@peter-evans Thanks for the quick answer!
In my case: I try to use your (great) action for just some days now. So I cannot ensure that it worked before.

@novotl @izavads Did it work for you before?

from enable-pull-request-automerge.

izavads avatar izavads commented on July 18, 2024

@Celebrate-Reinhard I am a new user as well.

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on July 18, 2024

Ah, my misunderstanding. In that case, please check that you are fulfilling the conditions described here:
https://github.com/peter-evans/enable-pull-request-automerge#conditions

from enable-pull-request-automerge.

izavads avatar izavads commented on July 18, 2024

@peter-evans , yeah I've created a PAT and using it as a secret , auto merge is also enabled under the pull request setting. still getting the same message.

from enable-pull-request-automerge.

izavads avatar izavads commented on July 18, 2024

@peter-evans @novotl @Celebrate-Reinhard
Thanks Peter , I was missing 1 condition (3) : 'The pull request must be in a state where requirements have not yet been satisfied.'

My issue was that the automerge job was set to wait for the job that makes the state to be satisfied , which breaks the condition mentioned above ....
Once moved the automerge job to be the first job without any dependency it works as expected .

from enable-pull-request-automerge.

Celebrate-Reinhard avatar Celebrate-Reinhard commented on July 18, 2024

@izavads

Once moved the automerge job to be the first job without any dependency it works as expected .

Can you give more details how exactly you did it?

I tried the same and split them up into two different workflows. -> Same error:

While some checks are still running (and therefor the auto-merge requirements are not satisfied), the auto merge is already failing 🤔

grafik

In the screenshot the button already says "Merge pull request". I have the feeling that that is already wrong. Shouldn't that be anything like "prepare for automerge"?

from enable-pull-request-automerge.

Celebrate-Reinhard avatar Celebrate-Reinhard commented on July 18, 2024

@peter-evans suggestion for making your docu even clearer:

The pull request base must have a branch protection rule with at least one requirement enabled.
In most cases a good candidate for this is a CI job with integration tests that runs for every PR anyway. Add that one in Settings > Branches > Branch protection rule > Require status checks to pass before merging

Thank you for your help and the great action you created!

from enable-pull-request-automerge.

novotl avatar novotl commented on July 18, 2024

In our case another repo admin removed the branch protection rule, so there was no required condition to wait for and it could be merged immediately. After adding back the required check all works fine 👍 .

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on July 18, 2024

Thanks @williamboman

Released as v2.2.0 / v2

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.