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

Q: how to trigger automerge after the checks finish? #170

Open
PovilasAtPoq opened this issue Aug 20, 2021 · 7 comments · Fixed by GradedJestRisk/github-training#16
Open
Labels
enhancement New feature or request

Comments

@PovilasAtPoq
Copy link

I assumed that check_suite type completed would be the check which runs after all checks passes. Howerver, it happened now twice: if PR reviews happens before the build check passes, then it's not being merged.

My config

name: automerge
on:
  pull_request:
    types:
      - labeled
  pull_request_review:
    types:
      - submitted
  check_suite:
    types:
      - completed

Merge not happening after the checks complete
image

@pascalgn
Copy link
Owner

pascalgn commented Sep 3, 2021

Did you have a look at all the events that triggered automerge-action runs? It might be that the build sends the "status" event and not "check_suite"

@PovilasAtPoq
Copy link
Author

Did you have a look at all the events that triggered automerge-action runs? It might be that the build sends the "status" event and not "check_suite"

I did try to look it up, but I couldn't find a reasonable event. I assumed one by default would use such an even so would know how it's called. Hence, posted here.

I will try to add

on:
  status

Seems that status doesn't have any types

@pascalgn
Copy link
Owner

pascalgn commented Sep 7, 2021

Yes, it doesn't have any types, see the usage example in the README: https://github.com/pascalgn/automerge-action#usage

@PovilasAtPoq
Copy link
Author

Yes, it doesn't have any types, see the usage example in the README: pascalgn/automerge-action#usage

thank you

so i ended up adding

	status: {}

and just tested, and it merged it! :) Thank you for your help and the auto-merger itself!

@gturi
Copy link

gturi commented Sep 11, 2021

Yes, it doesn't have any types, see the usage example in the README: https://github.com/pascalgn/automerge-action#usage

Hi, I think it could be useful to add a comment like:

status: {} # necessary to trigger the action after the other checks have been completed

in the usage sample.
I also had this problem and I could not figure out what I was doing wrong, since github check_suite event is quite misleading.

@ddelange
Copy link

ddelange commented Feb 1, 2022

For me, status: {} does not seem to work, so I went with a manual trigger at the end of the job in question:

# CI.yaml
      ...
      # last step of the CI job
      - name: Trigger automerge
        uses: peter-evans/repository-dispatch@v1
        with:
          token: ${{ secrets.TOKEN }}  # generate a personal access token with `public_repo` scope (write access)
          event-type: checks-complete

and then explicitly add this event as trigger to the automerge workflow:

# automerge.yaml
on:
  # trigger when checks complete (manually triggered as final step of CI workflow)
  repository_dispatch:
    types: [checks-complete]

@marcospassos
Copy link
Contributor

Same here. Sometimes it works; other times, it doesn't. Removing and reading the tags triggers the workflow, but the experience is not as smooth as it could be.

Dennis-Nedry-From-Jurassic-Park added a commit to Dennis-Nedry-From-Jurassic-Park/backend-repository-template-rust that referenced this issue Apr 22, 2022
Dennis-Nedry-From-Jurassic-Park added a commit to Dennis-Nedry-From-Jurassic-Park/backend-repository-template-rust that referenced this issue Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants