{"id":25491547,"url":"https://github.com/slavcodev/coverage-monitor-action","last_synced_at":"2025-04-05T10:08:45.162Z","repository":{"id":37820953,"uuid":"221217250","full_name":"slavcodev/coverage-monitor-action","owner":"slavcodev","description":"A GitHub Action that monitor coverage.","archived":false,"fork":false,"pushed_at":"2024-10-09T12:00:12.000Z","size":3684,"stargazers_count":46,"open_issues_count":1,"forks_count":16,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-14T13:04:25.537Z","etag":null,"topics":["action","coverage"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/slavcodev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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}},"created_at":"2019-11-12T12:52:11.000Z","updated_at":"2024-10-09T12:00:13.000Z","dependencies_parsed_at":"2023-01-11T17:21:23.422Z","dependency_job_id":"43ce921c-f35c-44ac-96c8-3e8ce492edc6","html_url":"https://github.com/slavcodev/coverage-monitor-action","commit_stats":{"total_commits":540,"total_committers":4,"mean_commits":135.0,"dds":0.1333333333333333,"last_synced_commit":"f5d2da9a1e6df3cc2379be73a82c92f203a3e08d"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slavcodev%2Fcoverage-monitor-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slavcodev%2Fcoverage-monitor-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slavcodev%2Fcoverage-monitor-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slavcodev%2Fcoverage-monitor-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slavcodev","download_url":"https://codeload.github.com/slavcodev/coverage-monitor-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247112739,"owners_count":20885606,"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":["action","coverage"],"created_at":"2025-02-18T22:17:55.596Z","updated_at":"2025-04-05T10:08:45.130Z","avatar_url":"https://github.com/slavcodev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coverage monitor\n\n[![Status][ico-github-actions]][link-github]\n[![Latest Version][ico-version]][link-github]\n[![License][ico-license]][link-license]\n[![License][ico-stand-with-ukraine]][link-stand-with-ukraine]\n\n[ico-github-actions]: https://github.com/slavcodev/coverage-monitor-action/workflows/build/badge.svg\n[ico-version]: https://img.shields.io/github/tag/slavcodev/coverage-monitor-action.svg?label=latest\n[ico-license]: https://img.shields.io/badge/License-MIT-blue.svg\n[ico-stand-with-ukraine]: https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg\n\n[link-github]: https://github.com/slavcodev/coverage-monitor-action\n[link-license]: LICENSE\n[link-contributing]: .github/CONTRIBUTING.md\n[link-stand-with-ukraine]: https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md\n\nA GitHub Action that monitor coverage.\n\n## Usage\n\n### Pre-requisites\n\nCreate a workflow `.yml` file in your repositories `.github/workflows` directory.\n\n### Inputs\n\n\n| Options | Description |\n| :-- | :-- |\n| `github_token` | **Required.** The GITHUB_TOKEN secret. |\n| `coverage_path` | **Required.** Path to coverage reports. |\n| `coverage_format` | Format of coverage, supported: `auto`, `clover` and `json-summary`. Defaults to `auto`. |\n| `working_dir` | The working directory of the action. Defaults to workflow workspace. |\n| `clover_file` | **Deprecated.** Path to Clover XML file. Prefer `coverage_path` instead of `clover_file`. |\n| `threshold_alert` | Mark the build as unstable when coverage is less than this threshold. Defaults to `50`. |\n| `threshold_warning` | Warning when coverage is less than this threshold. Defaults to `90`. |\n| `threshold_metric` | A metric to check threshold on, supported: `statements`, `lines`, `methods` or `branches`. Defaults to `lines`. |\n| `check` | Whether check the coverage thresholds. Default to `true`. Ignored when event does not support checks, is not `pull_request`. |\n| `status_context` | A string label to differentiate this status from the status of other systems. Defaults to `Coverage Report`. |\n| `comment` | Whether comment the coverage report. Default to `true`. Ignored when event does not support comments, is not `pull_request`. |\n| `comment_context` | A string label to differentiate the comment posted by this action. Defaults to `Coverage Report`. |\n| `comment_mode` | A mode for comments, supported: `replace`, `update` or `insert`. Defaults to `replace`. |\n| `comment_footer` | Whether comment may contain footer. Defaults to `true`.\n\n### Example workflow \n\n~~~yaml\nname: Tests\non: [pull_request]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    permissions:\n        contents: read\n        pull-requests: write\n        statuses: write\n\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Test\n        run: npm test\n\n      - name: Monitor coverage\n        uses: slavcodev/coverage-monitor-action@v1\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          coverage_path: \"logs/clover.xml\"\n          threshold_alert: 10\n          threshold_warning: 50\n          threshold_metric: \"lines\"\n~~~\n\n### Permissions for the `GITHUB_TOKEN`\n\nThe action requires access to certain resources, thus requires the secret `GITHUB_TOKEN` with certain permissions.\n\nThe minimum required permissions includes the following (without considering the other steps of your job):\n\n~~~yaml\n\npermissions:\n    # Access to your repository.\n    contents: read\n    # Access to pull request. The `write` access if you the `comment` is enabled\n    # within the action, otherwise can be `read`. \n    pull-requests: write\n    # Access to pull request statuses. The `write` access if you the `check` is enabled\n    # within the action, otherwise can be `read`.\n    statuses: write\n~~~\n\nRefer to the documentation on settings at the following URLs:\n* [Automatic Token Authentication - GitHub Docs](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow)\n* [Assigning Permissions to Jobs - GitHub Docs](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs)\n* [Permissions required for GitHub Apps - GitHub Docs](https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps)\n\n## Preview\n\n[![Screenshot][img-screenshot-dark]][link-example-pr]\n[![Screenshot][img-screenshot-light]][link-example-pr]\n\n[img-screenshot-dark]: screenshot.png#gh-dark-mode-only\n[img-screenshot-light]: screenshot-light.png#gh-light-mode-only\n[link-example-pr]: https://github.com/slavcodev/coverage-monitor-action/pull/1\n\n## Contributing\n\nWe would love for you to contribute, pull requests are welcome!\nPlease see the [CONTRIBUTING.md][link-contributing] for more information.\n\n\n## License\n\n[MIT License][link-license]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslavcodev%2Fcoverage-monitor-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslavcodev%2Fcoverage-monitor-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslavcodev%2Fcoverage-monitor-action/lists"}