{"id":21816582,"url":"https://github.com/5monkeys/cobertura-action","last_synced_at":"2025-04-07T14:14:10.777Z","repository":{"id":37966448,"uuid":"232299408","full_name":"5monkeys/cobertura-action","owner":"5monkeys","description":"GitHub Action to report cobertura coverage ","archived":false,"fork":false,"pushed_at":"2024-07-18T12:44:38.000Z","size":16564,"stargazers_count":67,"open_issues_count":34,"forks_count":70,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T12:05:35.305Z","etag":null,"topics":["actions","coverage","github"],"latest_commit_sha":null,"homepage":"","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/5monkeys.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}},"created_at":"2020-01-07T10:21:28.000Z","updated_at":"2025-02-10T03:56:29.000Z","dependencies_parsed_at":"2024-06-18T13:36:49.344Z","dependency_job_id":"bb1ae176-7c3c-427a-b818-8ba052fe48e5","html_url":"https://github.com/5monkeys/cobertura-action","commit_stats":{"total_commits":47,"total_committers":14,"mean_commits":3.357142857142857,"dds":0.5957446808510638,"last_synced_commit":"18d911b62098eafd8b9db93d6c74194556cc3515"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5monkeys%2Fcobertura-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5monkeys%2Fcobertura-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5monkeys%2Fcobertura-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5monkeys%2Fcobertura-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5monkeys","download_url":"https://codeload.github.com/5monkeys/cobertura-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247666015,"owners_count":20975788,"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":["actions","coverage","github"],"created_at":"2024-11-27T15:35:22.034Z","updated_at":"2025-04-07T14:14:10.753Z","avatar_url":"https://github.com/5monkeys.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cobertura action\n\n![](https://github.com/5monkeys/cobertura-action/workflows/Test/badge.svg)\n\nGitHub Action which parse a [XML cobertura report](http://cobertura.github.io/cobertura/) and display the metrics in a GitHub Pull Request.\n\nMany coverage tools can be configured to output cobertura reports:\n\n* [coverage.py](https://coverage.readthedocs.io/en/latest/cmd.html#xml-reporting)\n* [Istanbul](https://istanbul.js.org/docs/advanced/alternative-reporters/#cobertura)\n* [Maven](https://www.mojohaus.org/cobertura-maven-plugin/)\n* [simplecov](https://github.com/colszowka/simplecov/blob/master/doc/alternate-formatters.md#simplecov-cobertura)\n\nThis action will not currently work when triggered by pull requests from forks, like is common in open source projects.\nThis is because the token for forked pull request workflows does not have write permissions on the target repository.\nHopefully GitHub will have a solution for this in the future. In the meantime one can use utilize multiple workflows and\nartifacts to circumvent this. See the workflows in this project for an implementation example and this blog post https://securitylab.github.com/research/github-actions-preventing-pwn-requests.\n\n\n## How it looks like\n\nA comment is added to the pull request with the coverage report.\n\n![alt text](img/comment.png \"Pull request comment with metrics\")\n\nA check is added to the workflow run.\n\n![alt text](img/check.png \"Check with metrics\")\n\nThe check will succeed or fail based on your threshold when `fail_below_threshold` is set to `true`, this allows you to mandate coverage checks pass on your [protected branches](https://docs.github.com/en/github/administering-a-repository/defining-the-mergeability-of-pull-requests/about-protected-branches).\n\n## Inputs\n\n### `repo_token`\n\nThe GITHUB_TOKEN. Defaults to `${{github.token}}`\n\n### `path`\n\nThe path to the cobertura report. Defaults to `coverage.xml`. Glob pattern is supported, for example `coverage/*.xml`.\n\n### `skip_covered`\n\nIf files with 100% coverage should be ignored. Defaults to `true`.\n\n### `minimum_coverage`\n\nThe minimum allowed coverage percentage as an integer.\n\n### `fail_below_threshold`\n\nFail the action when the minimum coverage was not met.\n\n### `show_line`\n\nShow line rate as specific column.\n\n### `show_branch`\n\nShow branch rate as specific column.\n\n### `show_class_names`\n\nShow class names instead of file names.\n\n### `show_missing`\n\nShow line numbers of statements, per module, that weren't executed.\n\n### `show_missing_max_length`\n\nCrop missing line numbers strings that exceeds this length, provided as an integer.\n\nDefault is no crop.\n\n(Note: \"\u0026hellip;\" is appended to a cropped string)\n\n### `link_missing_lines`\n\nLink missing line numbers. This only has an effect when `show_missing` is set to `true`.\nDefaults to `false`.\n\n### `link_missing_lines_source_dir`\n\nAllows specifying a source directory for `link_missing_lines`, that will be inserted\ninto the resulting URLs, in-between the commit hash and the file path.\n\n### `only_changed_files`\n\nOnly show coverage for changed files.\n\n### `report_name`\n\nUse a unique name for the report and comment.\n\n### `pull_request_number` **Optional**\n\nPull request number associated with the report. This property should be used when workflow trigger is different than `pull_request`.\n\nIf no pull request can determine the action will skip adding the comment.\n\n## Example usage\n\n```yaml\non:\n  pull_request:\n    types: [opened]\n    branches:\n      - master\njobs:\n  coverage:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: 5monkeys/cobertura-action@master\n        with:\n          path: src/test.xml\n          minimum_coverage: 75\n```\n\n## Development\n\n- Install deps: `npm ci`\n- Run tests: `npm run test`\n- Run lint: `npm run lint`\n- Package application `npm run package`. Remember to run this before committing anything.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5monkeys%2Fcobertura-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5monkeys%2Fcobertura-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5monkeys%2Fcobertura-action/lists"}