Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 4

check_run conclusion

Solved! Go to Solution.

Hi I'm trying to setup a course for my student, to assert some assigments.
But debug events is not that easy although doable.

 

The step that I'm trying to validate is fairly simple:

 

  • The students enables CI
  • The CI check succeed
  • An issue is closed and would proceed on the next step

 

The mention step can be find https://github.com/M3kH/hyf-course-nodejs-3/blob/master/config.yml#L57

 

I'm doing something wrong? How to debug better check_run events? where can I read the payload of it?

3 Replies
Copilot Lvl 3
Message 2 of 4

Re: check_run conclusion

Another way to do it is enable CI check on the protection rules for the branch.

Althought I didn't manage to disable reviews trough updateBranchProtection. Is there any example?

Solution
Moderator
Message 3 of 4

Re: check_run conclusion

Hi @M3kH!

 

If I understand correctly you're trying to trigger a step when a `check_run` has completed, and is successful?

 

You should be able to do something like this:

 

steps:
  - title: My step
    event: check_run.completed
    actions:
      - type: gate
        left: '%payload.check_run.conclusion%'
        operator: ===
        right: success

 

First we use the check_run.completed event to trigger the step, and then we use the gate action to check that it was successful.

 

This will block the step from completing unless the check run ended with a successful status. You can learn more about the check run event here: https://developer.github.com/v3/activity/events/types/#checkrunevent

 

Let me know if that helps at all!

 

Cheers,

Jason

Copilot Lvl 3
Message 4 of 4

Re: check_run conclusion

Indeed this helped, thanks @JasonEtco