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

feat(workflow): add check_run and check_suite #8

Closed

Conversation

brad-decker
Copy link

@brad-decker brad-decker commented Jul 19, 2019

Testing this on our application first, but hopefully adds support for check_run and check_suite

@pascalgn
Copy link
Owner

Sorry for not getting back earlier: Is it ready from your perspective?

async function handleCheckUpdate(context, eventName, event) {
const { action } = event;
const payload = eventName === 'check_suite' ? event.check_suite : event.check_run;
if (action === 'completed') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this code, but shouldn't this be action !== 'completed'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be great to have in. Happy to update the PR.

How can I pull this branch locally or publish a canary build to check it with the update?

Copy link

@peter-mouland peter-mouland Oct 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately, didn't work for me (this PR with the (action !== 'completed') tweak). i got these messages:

INFO  No update necessary
INFO  PR is probably ready: mergeable_state: unknown
INFO  Failed to merge PR: Required status check "continuous-integration/jenkins/branch" is expected.

this is after the workflow yml with these on event types:

on:
  pull_request:
    types:
      - labeled
      - unlabeled
      - synchronize
      - opened
      - edited
      - ready_for_review
      - reopened
      - unlocked
  pull_request_review:
    types:
      - submitted
  check_suite:
    types:
      - completed
  check_run:
    types:
      - completed
  status: {}

It seems like the action is still triggered too early, and then not again once jenkins has finished.

@brad-decker
Copy link
Author

@pascalgn @peter-mouland I don't have the bandwidth at the moment to see this through, but I am still very much interested in this feature. If y'all want access to our fork I can add you as collaborators.

@peter-mouland
Copy link

@brad-decker no worries, I've forked the project and tried it on our servers with no luck... It looks like a great place to get started with this goal (rather than trying my own home-grown solution from scratch). When I get more time I'll give it another go. cheers

@brad-decker
Copy link
Author

If it helps this is our current configuration @peter-mouland ..

workflows/check_suite.yml:

on: check_suite
name: automerge pull requests on check
jobs:
  automaticMergeApprovedPRS:
    name: Automatic Merge Approved PRS
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Automatic Merge Approved PRS
      uses: MerlinLabs/automerge-action@8d5dc8967a5f1e7163a7f8d53e261aa0f2e19fae
      env:
        AUTOREBASE: 'Next To Merge :1st_place_medal:'
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        LABELS: "!blocked ✋,!Stage: WIP \U0001F6A7,Stage: Approved \U0001F389"
        MERGE_METHOD: rebase
        TOKEN: ${{ secrets.TOKEN }}

workflows/pull_request_review.yml

on: pull_request_review
name: automerge pull requests on reviews
jobs:
  automaticMergeApprovedPRS:
    name: Automatic Merge Approved PRS
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Automatic Merge Approved PRS
      uses: MerlinLabs/automerge-action@8d5dc8967a5f1e7163a7f8d53e261aa0f2e19fae
      env:
        AUTOREBASE: 'Next To Merge :1st_place_medal:'
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        LABELS: "!blocked ✋,!Stage: WIP \U0001F6A7,Stage: Approved \U0001F389"
        MERGE_METHOD: rebase
        TOKEN: ${{ secrets.TOKEN }}

workflows/pull_request

on: pull_request
name: automerge pull requests on updates
jobs:
  automaticMergeApprovedPRS:
    name: Automatic Merge Approved PRS
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Automatic Merge Approved PRS
      uses: MerlinLabs/automerge-action@8d5dc8967a5f1e7163a7f8d53e261aa0f2e19fae
      env:
        AUTOREBASE: 'Next To Merge :1st_place_medal:'
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        LABELS: "!blocked ✋,!Stage: WIP \U0001F6A7,Stage: Approved \U0001F389"
        MERGE_METHOD: rebase
        TOKEN: ${{ secrets.TOKEN }}

it currently works with this setup like <=50% of the time... 😬

@pascalgn
Copy link
Owner

I made retries + retry sleep configurable now (see also #30), so maybe that could help here?

@pblitz
Copy link
Contributor

pblitz commented Mar 10, 2020

i forked this one again in #60 - I guess github had changed it behavior quite a bit until now. Had to change it drastically enough that I didn't want to directly change this PR.

@pascalgn
Copy link
Owner

I've merged #60 now, so I'm closing this PR. If you have any objections, just let me know and/or reopen it again! Thanks! 👍

@pascalgn pascalgn closed this Mar 15, 2020
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

Successfully merging this pull request may close these issues.

5 participants