tibdex / autosquash

:package: GitHub Action to update PRs with outdated checks and squash and merge the ones matching all branch protections

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autosquash not updating the PR

gonditeniz opened this issue · comments

I created a PR, added the expected label but the PR has not been updated despite been outdated.

image

I had similar issue with Autorebase App lately although previously it was perfectly working.

It's hard to know what's wrong since the repo is private so I can't see its "Actions" tab. Have you signed up for the GitHub Actions beta? What's the content of your Autosquash workflow file? Have you tried using this one?

I had a similar issue, my github_token was not set properly in my repository.

Thanks for the answer.

Let me know any information that can help you identify the issue and I'll try to share it.

Regarding your questions:

  • We are part of the GitHub Actions beta.
  • The file I'm using is this one

Additionally, in the checks section I can see the following entries:

  • Autosquash / Autosquash (pull_request) Successful in 3s
  • Autosquash / Autosquash (pull_request) Successful in 3s
    They were executed in the moment I added the label and just once.

The log of the jobs is the following:

Set up job

Download action repository 'tibdex/autosquash@v2'

Current runner version: '2.160.0'

Prepare workflow directory

Prepare all required actions

Download action repository 'tibdex/autosquash@v2'

  Run tibdex/autosquash@v2

Mergeable state is blocked

Run tibdex/autosquash@v2

Consider merging or updating #4750

Fetching pull request details

Mergeable state is blocked

  Complete job

Cleaning up orphan processes```

I had a similar issue, my github_token was not set properly in my repository.

I reviewed that and it looks ok. Can you be more specific on "not set properly"?

Your log shows that the mergeable state is blocked. As explained in #23 (comment), Autosquash relies on this state to decide what to do.

The relevant part of the code is this:

const updateableMergeableStates: MergeableState[] = [
// When "Require branches to be up to date before merging" is checked
// and the pull request is missing commits from its base branch,
// GitHub will consider its mergeable state to be "behind".
"behind",
];
const potentialMergeableStates: MergeableState[] = [
"clean",
// When checks are running on a pull request,
// GitHub considers its mergeable state to be "unstable".
// It's what will happen when the Autosquash action is
// running so we need to attempt a merge even in that case.
"unstable",
];

Did you enable the "Require branches to be up-to-date before merging" branch protection?

The "Require branches to be up-to-date before merging" branch protection is enabled.

As far as I can see in the code, blocked state is not taken into account neither for merge nor for update. What should happen in that case?

Same happens to me, I was going to try Autorebase but it might have the same issue as you said. I tried removing and adding the label, and the same error is thrown.

Based on octokit/octokit.net#1763 (comment), maybe GitHub is returning blocked instead of behind because your "required status checks" protection is loose. If that's the case, can you try making it strict by checking the "Require branches to be up-to-date before merging" box?

The problem is that check run event isn't working:
Screen Shot 2019-11-23 at 18 16 31

I think Github or CircleCI (in my case) made a change recently to check_run because this was working and stopped working 2 days ago, I didn't do any change but now I went to the webhooks' events page and this was disabled:
Screen Shot 2019-11-22 at 16 36 52

Also, there was a problem in Travis as well https://stackoverflow.com/questions/58307570/github-actions-check-run-is-not-called.

I guess we cannot rely on this event but we might have another option. My github configuration:

Screen Shot 2019-11-23 at 18 17 59

Any update on this? Can we not rely on check_run and rely on other events for merging? for reference: https://github.com/tibdex/autosquash/blob/master/src/autosquash.ts#L359

Found the problem (but not the fix 😞)! It's when you enable this setting:
Screen Shot 2019-12-17 at 21 50 20

Found it thanks to kodiak that suffers the same issue, it seems a github limitation unless github actions can have more powers than bots (kodiak is a bot).