Disable Github Actions Check Runs from Annotating Files

Disable Github Actions Check Runs from Annotating Files

Looking for a way to disable Github Actions check runs from annotating files.

/* Context - Working on an eslint workflow action to comment on PR's, as it's annoying with this check runs annotating all files by default */

Ref PR-

2 Answers

Annotations are added when problem matchers finds a match in the logs.

For example. setup-node registers eslint problem matchers. which can be removed by

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
  with:
    node-version: '12'
- run: |
       echo "::remove-matcher owner=eslint-compact::"
       echo "::remove-matcher owner=eslint-stylish::"

You can also you the eslint action I wrote, that runs linter on changed files. . You can disable annotations by passing input args annotations: false

name: Lint

on:
  pull_request:
  push:
    branches:
      - master

jobs:
  eslint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
      - run: npm ci # or yarn install
      - uses: sibiraj-s/action-eslint@v1
        with:
          extensions: 'js, jsx, ts, tsx'
          annotations: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Read more about problem matchers here

Medium article for disabling annotations in other actions as well.

Observed that CLI error logs in terminal console are automatically invoking check-runs which is the reason for annotation as this seems to be a feature of Github Action itself by default and no way to disable it by any configuration.

For time being I managed to stop the annotations by capturing those CLI logs output as XML format separately via a listener instead of directly letting the error to log in terminal console.

Still a configuration level option to toggle check-runs from annotating should be made available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.