{"id":21816389,"url":"https://github.com/neofinancial/coverage-upload-action","last_synced_at":"2025-10-16T09:34:04.678Z","repository":{"id":37212097,"uuid":"456722659","full_name":"neofinancial/coverage-upload-action","owner":"neofinancial","description":"Parses coverage file and uploads to remote endpoint","archived":false,"fork":false,"pushed_at":"2024-12-24T21:26:52.000Z","size":4186,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-27T15:21:16.683Z","etag":null,"topics":["coverage","github-actions","squad-dx"],"latest_commit_sha":null,"homepage":"","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/neofinancial.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-08T00:10:22.000Z","updated_at":"2025-02-28T14:07:41.000Z","dependencies_parsed_at":"2024-02-13T19:28:49.796Z","dependency_job_id":"82a25a4d-eb3c-4534-8d87-80edefa1c617","html_url":"https://github.com/neofinancial/coverage-upload-action","commit_stats":{"total_commits":17,"total_committers":6,"mean_commits":"2.8333333333333335","dds":0.6470588235294117,"last_synced_commit":"a77f313d80effa4cc9ecc4cdacd12b3ee8ff8301"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neofinancial%2Fcoverage-upload-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neofinancial%2Fcoverage-upload-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neofinancial%2Fcoverage-upload-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neofinancial%2Fcoverage-upload-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neofinancial","download_url":"https://codeload.github.com/neofinancial/coverage-upload-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248565086,"owners_count":21125415,"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":["coverage","github-actions","squad-dx"],"created_at":"2024-11-27T15:34:08.123Z","updated_at":"2025-10-16T09:33:59.632Z","avatar_url":"https://github.com/neofinancial.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coverage Upload Action\n\nUpload code coverage data to a remote server\n\n## Overview\n\nThis action will display the current coverage on any pull requests. You can also provide a remote endpoint to receive the coverage data and respond with the difference in coverage between the current branch and base branch, or a string to be displayed in the comment.\n\nThe pull request comment contains the following information:\n\n```txt\n|           | Hit | Found | Percentage | Difference |\n| --------- | --- | ----- | ---------- | ---------- |\n| Lines     |     |       |            |            |\n| Functions |     |       |            |            |\n| Branches  |     |       |            |            |\n```\n\nIf your data is not sent to a remote endpoint the difference column will not be shown. Information on how to respond to the action to appropriately display the difference is available in the below REST API message format section.\n\n## Usage\n\nIn your `.github/workflows` directory make a new workflow file that runs on pull requests and pushes to the default branch.\n\n```yml\nname: CI\n\non:\n  pull_request:\n    types: ['opened', 'reopened', 'synchronize']\n  push:\n    branches: ['master']\n\njobs:\n  title:\n    name: run tests\n    runs-on: ubuntu-latest\n    steps:\n      - name: Test\n        run: npm test -- --coverage\n      - name: Upload coverage\n        uses: neofinancial/coverage-action\n        with:\n          coverageEndpoint: https://your.endpoint.here\n          coverageToken: ${{ secrets.COVERAGE_TOKEN }}\n          ignoreBots: 'true'\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\nIf you have an existing workflow that runs your tests you can just add the `Upload coverage` step at the end of that workflow.\n\nIf you want the action to run for pull requests created by bots (dependabot, crowdin etc) set the ignoreBots field to false\n\n```\n  ...\n  with:\n    coverageEndpoint: https://your.endpoint.here\n    coverageToken: ${{ secrets.COVERAGE_TOKEN }}\n    ignoreBots: 'false'\n  ...\n```\n\n## Settings\n\n| Name             | Description                                                            | Default              | Required |\n| ---------------- | ---------------------------------------------------------------------- | -------------------- | -------- |\n| coverageEndpoint | The remote endpoint to upload coverage data to                         | null                 | No       |\n| coverageToken    | A token to authenticate with the remote endpoint and identify the repo | null                 | No       |\n| coverageData     | The location of the lcov file containing coverage information          | `coverage/lcov.info` | No       |\n\n## REST API Message Format\n\nThis action will send a POST request to the specified endpoint with a message that looks like this:\n\n```json\n{\n  \"id\": 218177808,\n  \"actor\": \"a-github-user\",\n  \"hash\": \"3ba1efac955942305a038ba37d25e20b4d2092e6\",\n  \"baseRef\": \"master\",\n  \"ref\": \"my-branch\",\n  \"functionsHit\": 10,\n  \"functionsTotal\": 20,\n  \"linesHit\": 77,\n  \"linesTotal\": 101,\n  \"branchesHit\": 19,\n  \"branchesTotal\": 23,\n  \"token\": \"secret\"\n}\n```\n\nThe `id` field is the GitHub repository ID and is added automatically. The `token` field is the token generated by your API service to authenticate and identify the repository.\n\nThe action expects to receive one of two responses from the POST request to the remote endpoint:\n\nresponse body:\n\n```json\n{\n  \"type\": \"difference\",\n  \"data\": {\n    \"linesDifference\": \"int\",\n    \"functionsDifference\": \"int\",\n    \"branchesDifference\": \"int\"\n  }\n}\n```\n\nwhere these above values are the % change in coverage for a particular metric and will be displayed in the `difference` column in the comment posted by the action\n\nor alternatively ...\n\nresponse body:\n\n```json\n{\n  \"type\": \"comment\",\n  \"data\": {\n    \"comment\": \"string\"\n  }\n}\n```\n\nwhere these above value is a markdown string and will be displayed in the comment posted by the action\n\nWhether or not a response is received the action will print out general information about the repository and its code coverage:\n\n```\n\"Repo ID\": \"int\"\n\"Ref of branch being merged\":  \"string\"\n\"Ref of branch being merged into\":  \"string\"\n\"SHA of merge commit\": \"string\"\n\"PR creator\": \"string\"\n\"Time PR created\": \"date\"\n\"Lines percent\": \"int\"\n\"Functions percent\": \"int\"\n\"Branches percent\": \"int\"\n```\n\nThese values are the % change in coverage for a particular metric and will be displayed in the `difference` column in the comment posted by the action.\n\n## Contributing\n\n1. Test your changes (see below)\n1. Update the version in `package.json`\n1. Update `CHANGELOG.md`\n1. Commit your changes and open a pull request\n\n### Testing\n\n##### Testing Action changes in this repo\n\n1. In [build.yml](./.github/workflows/build.yml#L30) set the `Upload coverage` step's `uses` clause to `./`\n1. Open a pull request to run the `build` workflow. The code on your branch will be run for the `Upload coverage` step. Check the `Upload coverage` step's output for more details about your run.\n\n#### Testing Action against another repository\n\n1. In your repository that references this action, change your workflow's code from\n   `uses: neofinancial/coverage-upload-action@v1` to `uses: neofinancial/coverage-upload-action@\u003ccommit-hash\u003e` where the commit hash is the **full** commit hash you wish to test.\n1. If your other repository is running a local server you want to test changes against, make sure you change the `coverageEndpoint` in `build.yml` to an ngrok url that points towards your local server.\n1. Run the workflow that references this action.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneofinancial%2Fcoverage-upload-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneofinancial%2Fcoverage-upload-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneofinancial%2Fcoverage-upload-action/lists"}