eslint-annotate-action icon indicating copy to clipboard operation
eslint-annotate-action copied to clipboard

Annotations show up as part of a different workflow

Open oxc opened this issue 3 years ago • 5 comments
trafficstars

I have multiple workflows that get triggered on pull_request. One of them is called "Run tests for pull request" and has a job called "Run linter" that runs the eslint-annotate-action.

However, the annotations often show up as child of a completely unrelated workflow. It seems undeterministic under which workflow it shows up.

In the following example, the annotation results wrongly show up as part of the "Code coverage" workflow: image

Here is an excerpt from the workflow that runs the action:

name: Run tests for pull request

on:
  pull_request:
    branches: [main]

jobs:
  lint:
    name: Run linter
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Install Dependencies
        run: npm run install:all

      - name: Generate lint report
        run: npm run lint:report
        continue-on-error: true

      - name: Annotate Code Linting Results
        uses: ataylorme/[email protected]
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          report-json: eslint_combined_report.json

oxc avatar Jan 04 '22 14:01 oxc

The Action creates a new status check and the Action doesn't have control where that is displayed in the UI as far as I know. Do you have any suggestions on what the Action can do differently that would help resolve your issue?

ataylorme avatar May 02 '22 16:05 ataylorme

Thanks for your reply. You're right, this seems to be an issue in Github that many people are complaining about: https://github.community/t/github-actions-status-checks-created-on-incorrect-check-suite-id/16685

According to this thread, there does not seem to be a solution at the moment (using a Github App instead of an Action seems to be "the way").

Related threads:

  • https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380
  • https://github.community/t/associate-a-check-run-with-a-workflow/122540

Feel free to close this, or keep it open for whenever this might be possible to implement.

oxc avatar Jun 08 '22 12:06 oxc

Can't this be solved with setting an external_id when creating the check?

https://docs.github.com/en/rest/checks/runs#create-a-check-run:~:text=app%20is%20used.-,external_idstring,A%20reference%20for%20the%20run%20on%20the%20integrator%27s%20system.,-statusstring

noamgolani avatar Aug 24 '22 10:08 noamgolani

@noamgolani can you elaborate on how external_id would tie the status check to a job in the UI?

ataylorme avatar Jan 21 '23 23:01 ataylorme

The above linked docs say.

external_id string A reference for the run on the integrator's system.

That must be a reference to CI-s running outside GitHub Actions.

szepeviktor avatar Feb 03 '23 10:02 szepeviktor