{"id":13832155,"url":"https://github.com/liskin/gh-problem-matcher-wrap","last_synced_at":"2025-04-08T03:14:05.318Z","repository":{"id":44646246,"uuid":"299622658","full_name":"liskin/gh-problem-matcher-wrap","owner":"liskin","description":"Invoke linters, detect errors/warnings, show them as annotations. Supports PRs from forks, unlike other Actions.","archived":false,"fork":false,"pushed_at":"2024-11-18T08:50:37.000Z","size":263,"stargazers_count":21,"open_issues_count":5,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T18:21:46.360Z","etag":null,"topics":["ci","continuous-integration","continuous-testing","github","github-actions","hacktoberfest","linter","problem-matcher"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/problem-matcher-wrapper-linter-errors-as-annotations-even-for-fork-prs","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liskin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["liskin"],"custom":["https://www.paypal.me/lisknisi/5EUR"]}},"created_at":"2020-09-29T13:16:34.000Z","updated_at":"2024-11-12T23:43:57.000Z","dependencies_parsed_at":"2023-02-10T18:46:10.939Z","dependency_job_id":"6bedfb2e-0371-43b2-9a3f-727fa811a9e4","html_url":"https://github.com/liskin/gh-problem-matcher-wrap","commit_stats":{"total_commits":26,"total_committers":5,"mean_commits":5.2,"dds":0.3846153846153846,"last_synced_commit":"7c16c71e03425eca07dcec470004be43eef74f53"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liskin%2Fgh-problem-matcher-wrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liskin%2Fgh-problem-matcher-wrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liskin%2Fgh-problem-matcher-wrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liskin%2Fgh-problem-matcher-wrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liskin","download_url":"https://codeload.github.com/liskin/gh-problem-matcher-wrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767236,"owners_count":20992548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","continuous-integration","continuous-testing","github","github-actions","hacktoberfest","linter","problem-matcher"],"created_at":"2024-08-04T10:01:52.954Z","updated_at":"2025-04-08T03:14:05.281Z","avatar_url":"https://github.com/liskin.png","language":"JavaScript","funding_links":["https://github.com/sponsors/liskin","https://www.paypal.me/lisknisi/5EUR"],"categories":["JavaScript"],"sub_categories":[],"readme":"# GitHub Action: Problem Matcher wrapper\n\n[![GitHub License](https://img.shields.io/github/license/liskin/gh-problem-matcher-wrap)](https://github.com/liskin/gh-problem-matcher-wrap/blob/master/LICENSE)\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/liskin/gh-problem-matcher-wrap?sort=semver)](https://github.com/liskin/gh-problem-matcher-wrap/releases)\n[![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/liskin/gh-problem-matcher-wrap/latest/master?sort=semver)](https://github.com/liskin/gh-problem-matcher-wrap/commits/master)\n\n**Linter errors as annotations, even for fork PRs.**\n\nWrap your linter invocations with [Problem Matcher][] [add/remove][] to let\nGitHub actions detect any errors and warnings and show them as annotations. As\nopposed to existing Actions which use the Checks API, this one works correctly\neven for Pull Requests from forks, which is otherwise [problematic][problem]\nand probably isn't getting fixed [any time soon][problem-detail].\n\n[Problem Matcher]: https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md\n[add/remove]: https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers\n[problem]: https://github.com/actions/toolkit/issues/133\n[problem-detail]: https://github.com/actions/toolkit/issues/133#issuecomment-535514071\n\n**Problem Matcher wrapper** works differently (and happens to be much simpler):\n\n1. Tell GitHub Actions how to recognize errors in linter output\n2. Run the linter, any way you like (run command, docker, another action, …)\n3. Tell GitHub Actions to stop looking for errors of this particular linter so\n   that we can safely run other linters\n\nA screenshot and an example (further down) is worth a thousand words:\n\n![screenshot](https://user-images.githubusercontent.com/300342/94590765-83cca700-0287-11eb-871a-8e3c488e3188.png)\n\n## Usage\n\n```yaml\n    - name: flake8\n      uses: liskin/gh-problem-matcher-wrap@v2\n      with:\n        linters: flake8\n        run: flake8 src/\n    - name: mypy\n      uses: liskin/gh-problem-matcher-wrap@v2\n      with:\n        linters: mypy\n        run: mypy --show-column-numbers src/\n    - name: isort\n      uses: liskin/gh-problem-matcher-wrap@v2\n      with:\n        linters: isort\n        run: isort --check src/\n    - name: pytest\n      uses: liskin/gh-problem-matcher-wrap@v2\n      with:\n        linters: pytest\n        run: pytest\n```\n\n```yaml\n    - uses: liskin/gh-problem-matcher-wrap@v2\n      with:\n        action: add\n        linters: flake8, mypy\n    - name: Lint\n      run: |\n        # possibly complex multiline shell script\n        flake8 src/\n        mypy --show-column-numbers src/\n    - uses: liskin/gh-problem-matcher-wrap@v2\n      with:\n        action: remove\n        linters: flake8, mypy\n```\n\n### Parameters\n\n* `linters`\n  * Comma or whitespace separated list of Problem Matchers to add/remove.\n  * (Required)\n* `run`\n  * Command to run.\n  * (Required unless `action` is `add` or `remove`)\n* `action`\n  * If set to `add` or `remove`, do not run any command, just add/remove Problem Matchers.\n  * (Default: `run`)\n\n### Supported linters\n\n* [flake8](https://flake8.pycqa.org/)\n* [gcc](https://gcc.gnu.org/)\n* [isort](https://pycqa.github.io/isort/)\n* [mypy](http://mypy-lang.org/)\n* [pytest](https://pytest.org/)\n* [shellcheck](https://github.com/koalaman/shellcheck#readme) (`-f gcc` + gcc problem matcher)\n\nFor details, sources and licenses of individual problem matchers, see\n[problem-matchers/](problem-matchers/).\n\nPull Requests with additional linters welcome!\n\n### Annotation Limitations\n\nGitHub imposes limitations on the total number of annotations a step or job may create [[Source 1](https://github.community/t/annotation-limitation/17998/2)][[Source 2](https://github.community/t/maximum-number-of-annotations-that-can-be-created-using-github-actions-logging-commands/16991)]. If a linter finds more problems than what may be annotated, only a random subset of the reported errors/warnings will be annotated. In either case, all found errors are reported in the action's logs. The exact limitations are:\n\n- 10 warning annotations and 10 error annotations per step\n- 50 annotations per job (sum of annotations from all the steps)\n- 50 annotations per run (separate from the job annotations, these annotations aren’t created by users\n\n\nOne approach to (partially) counteract this limitation is to split the linting into multiple steps/jobs. This can be done on a per linter or per folder basis. Example:\n\n```yaml\njobs:\n  # this job can annotate up to 50 errors/warnings\n  lint_core:\n    ...\n    steps:\n      ...\n      # this step can annotate up to 10 errors/warnings\n      - name: Flake8 Module1\n        uses: liskin/gh-problem-matcher-wrap@v2\n        with:\n          linters: flake8\n          run: flake8 src/core/module1\n      # this step can annotate an additional 10\n      - name: Flake8 Module2\n        uses: liskin/gh-problem-matcher-wrap@v2\n        with:\n          linters: flake8\n          run: flake8 src/core/module2\n  # this job can annotate an additioanal 50 errors/warnings\n  lint_plugins:\n    ...\n    steps:\n      ...\n      # this step can annotate up to 10 errors/warnings\n      - name: Flake8\n        uses: liskin/gh-problem-matcher-wrap@v2\n        with:\n          linters: flake8\n          run: flake8 src/plugins/ \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliskin%2Fgh-problem-matcher-wrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliskin%2Fgh-problem-matcher-wrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliskin%2Fgh-problem-matcher-wrap/lists"}