checks-action icon indicating copy to clipboard operation
checks-action copied to clipboard

Not working when multiple workflows are triggered by a commit

Open zolex opened this issue 2 years ago • 4 comments

When you have have multiple workflows that can be triggered by the same commit, the checks-action only adds the checks to the first executed workflow.

here is the debug output of the first exectued workflow, that was able to add the run-check in it's summary:

Run LouisBrunner/[email protected]
  with:
    token: ***
    repo: modix/base
    sha: f396e2c2c4e53761830f906bcaf4bef2e56c08a0
    name: Build Image
    status: completed
    conclusion: success
    output: {
    "summary": "Build status: success",
    "text_description": "Image pushed to [***.dkr.ecr.eu-central-1.amazonaws.com/modix/base/php:8-cli](https://eu-central-1.console.aws.amazon.com/ecr/repositories/private/***/modix/base/php)"
  }
##[debug]Parsing inputs
##[debug]Setting up OctoKit
##[debug]Creating a new Run on modix/base@f396e2c2c4e53761830f906bcaf4bef2e56c08a0
::set-output name=check_id::3597153344
##[debug]='3597153344'
##[debug]Done

the summary then looks like this:

image

and here is the debug output another workflow run that is triggered by the same commit but runs after the first workflow (same result for all but the first)

Run LouisBrunner/[email protected]
  with:
    token: ***
    repo: modix/base
    sha: f396e2c2c4e53761830f906bcaf4bef2e56c08a0
    name: Build Image
    status: completed
    conclusion: success
    output: {
    "summary": "Build status: success",
    "text_description": "Image pushed to [***.dkr.ecr.eu-central-1.amazonaws.com/modix/base/node:16](https://eu-central-1.console.aws.amazon.com/ecr/repositories/private/***/modix/base/node)"
  }
##[debug]Parsing inputs
##[debug]Setting up
 OctoKit
##[debug]Creating a new Run on modix/base@f396e2c2c4e53761830f906bcaf4bef2e56c08a0
::set-output name=check_id::3597139023
##[debug]='3597139023'
##[debug]Done

in this workflow the run-checks are not displayed/not added to the run, though the debug output says everything was working fine....

image

zolex avatar Sep 14 '21 11:09 zolex

I'm also experiencing this

Jamesking56 avatar Oct 29 '21 14:10 Jamesking56

Hi @zolex, thanks for your report!

What happens if you call the Checks differently? (it looks like both are called "Build Image"?)

LouisBrunner avatar Nov 12 '21 15:11 LouisBrunner

Might be related to https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380/18

The check-run seems to be posted under the wrong suite when pointing at a different commit or outside job

prince-chrismc avatar Dec 15 '21 05:12 prince-chrismc

Yeah, looks like it.

LouisBrunner avatar Dec 24 '21 10:12 LouisBrunner

Is there an update on this?

lukasmalkmus avatar Aug 12 '22 10:08 lukasmalkmus

@lukasmalkmus I am not sure if there is any way to fix this as it looks like an issue from GitHub (we can't specify the suite when creating a Check, instead we rely only on the SHA and hope that GitHub does the correlation correctly, which it doesn't always).

LouisBrunner avatar Aug 31 '22 13:08 LouisBrunner

We have been able to solve this problem, using the token of a GitHub App (instead of GITHUB_TOKEN). In this way, the check run is associated with a specific new check suite associated with the GitHub App.

We use this other action to generate a temporally GitHub App token for use in the workflow https://github.com/peter-murray/workflow-application-token-action

This configuration must also be taken into account in the repo settings. image

alambike avatar Aug 31 '22 13:08 alambike