Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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- https://github.com/tamdilip/ember_poc/pull/143/files

like image 449
Dilipan Avatar asked Sep 10 '26 05:09

Dilipan


1 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. https://github.com/sibiraj-s/action-eslint. 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

https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers

Medium article for disabling annotations in other actions as well. https://sibiraj-s.medium.com/disable-annotations-in-github-actions-ff938d5ea4f3

like image 91
Sibiraj Avatar answered Sep 12 '26 16:09

Sibiraj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!