Github Actions randomly skips "This check was skipped"

Sometimes an action that is triggered by assignment will not run and the message is “This check was skipped”. Usually we simply un-assign and re-assign and the action launches. We see this regularly.

You can see examples here (PR 717): https://github.com/Autodesk/maya-usd/actions
The first two fail and the third launches. There’s no log. Where can I check what happened?

There is a trigger and a check.

Trigger
on:
pull_request:
branches: [dev]
types: [assigned]

Check
if: contains(toJson(github.event.pull_request.assignee), ‘ecp-maya-devops-adsk’)

Thanks,
William

@smithw-adsk,

According to the if conditional you set in your workflow,

if: contains(toJson(github.event.pull_request.assignee), 'ecp-maya-devops-adsk')

it will check the whole context of the “github.event.pull_request.assignee” object to see if it contains the string or sub-string “ecp-maya-devops-adsk”.
The “github.event.pull_request.assignee” object generally contains the information of the earliest added assignee existing in current Assignees.

What is your real purpose?

  1. You want the job (check) in the workflow only runs when the latest added assignee is the user named “ecp-maya-devops-adsk”.
    If so, the expression you are using is not accurate and strict. You can use the expression “github.event.assignee.login” to get the login name of the latest added assignee, and the if conditional should look like this.

    if: ${{ github.event.assignee.login == 'ecp-maya-devops-adsk' }}
    
  2. You want the job (check) in the workflow only runs when the Assignees contains the user named “ecp-maya-devops-adsk”.
    If so, you can use the expression “github.event.pull_request.assignees” to get the assignees object which is an array contains the information of all the existing assignees. And use the expression “github.event.pull_request.assignees.*.login” to extract the login names of the assignees into an array from the assignees object.
    Then, the if conditional should look like this.

    if: ${{ contains(github.event.pull_request.assignees.*.login, 'ecp-maya-devops-adsk') }}
    

@brightran

Your suggestions are more accurate and our requirement is the first one you listed. It’s been very reliable in testing and I’ll put it into our action.

Thanks for your help.
William

@smithw-adsk,

So, this if conditional can solve the problem you are facing and meet your requests.

if: ${{ github.event.assignee.login == 'ecp-maya-devops-adsk' }}

Glad that my suggestions can help you.

If possible, you can mark my above suggestions as solution of this topic, so that other users who have the similar problems can notice these suggestions. Thanks.

Hello brightran,

Your suggestion seems to have solved the issue for us.

if: ${{ github.event.assignee.login == 'ecp-maya-devops-adsk' }}

Thanks for your help!
William