{"id":30880667,"url":"https://github.com/linkdata/gitcoverage","last_synced_at":"2026-03-04T15:04:03.306Z","repository":{"id":311901067,"uuid":"1045427270","full_name":"linkdata/gitcoverage","owner":"linkdata","description":"Manage code coverage badges and reports","archived":false,"fork":false,"pushed_at":"2025-08-27T11:29:49.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-27T19:09:25.427Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/linkdata.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,"zenodo":null}},"created_at":"2025-08-27T06:40:51.000Z","updated_at":"2025-08-27T11:29:09.000Z","dependencies_parsed_at":"2025-08-27T19:10:53.984Z","dependency_job_id":"6e54a49a-f159-40ce-99e2-ade877378f99","html_url":"https://github.com/linkdata/gitcoverage","commit_stats":null,"previous_names":["linkdata/gitcoverage"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/linkdata/gitcoverage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fgitcoverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fgitcoverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fgitcoverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fgitcoverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkdata","download_url":"https://codeload.github.com/linkdata/gitcoverage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fgitcoverage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274147849,"owners_count":25230390,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-09-08T07:11:12.450Z","updated_at":"2026-03-04T15:04:03.290Z","avatar_url":"https://github.com/linkdata.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![coverage](https://github.com/linkdata/gitcoverage/blob/main/coverage_badge_animated.svg)](#)\n\n# gitcoverage\n\nGenerate code coverage badge and push it and optional HTML report to the 'coverage' branch.\n\nThis action has no dependencies except for `git`, the `bash` shell and common *nix command line utilities\n`awk`, `sed` and GNU coreutils (`mkdir, cp, rm, ls, cat, echo, printf`). This means it won't run on Windows\nrunners; use `if: runner.os != 'Windows'` to exclude those in the workflow.\n\nGit features required by this action:\n- `git worktree add --detach` (documented in Git 2.5.6)\n- `git branch --format` (present in Git 2.13.7, absent in 2.12.5)\n- `git rev-parse --is-shallow-repository` (added in Git 2.15 release notes)\n\nTherefore, use **Git 2.15.0 or newer**.\n\n## Usage\n\nYou need to have given write permissions for the for the workflow.\nIf the 'coverage' branch does not exist, it will be created as an orphan (without main repo history).\nReference the generated badge in your README.md like this:\n\n```md\n[![coverage](https://github.com/USERNAME/REPO/blob/coverage/BRANCH/badge.svg)](#)\n```\n\nIf you submitted a detailed HTML report of the coverage to the action, replace the '#' with:\n\n`https://html-preview.github.io/?url=https://github.com/USERNAME/REPO/blob/coverage/BRANCH/report.html`\n\n### Inputs\n\n- `coverage` (required): Coverage percentage (for example `83` or `83%`).\n- `report` (optional): Path to an HTML report file to publish as `report.html`.\n- `branch` (optional): Source branch override. Recommended for tag-triggered workflows where multiple branches may contain the same tag commit.\n  Also recommended for very large or restricted repos to avoid scanning all remote branches during tag-triggered branch resolution.\n\n## Examples\n\nInside your .github/workflows/workflow.yml file:\n\n```yml\npermissions:\n  contents: write\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: linkdata/gitcoverage@v3\n        with:\n          coverage: \"83%\"\n          report:   \"coveragereport.html.out\"\n```\n\nMore complete example using Go:\n\n```yml\npermissions:\n  contents: write\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        go:\n          - \"stable\"\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Set up Go\n        uses: actions/setup-go@v5\n        with:\n          go-version: ${{ matrix.go }}\n\n      - name: Go Generate\n        run: go generate ./...\n\n      - name: Go Test\n        run: go test -coverprofile=coverage ./...\n\n      - name: Go Build\n        run: go build .\n\n      - name: Calculate code coverage\n        if: runner.os != 'Windows'\n        id: coverage\n        run: |\n          echo \"COVERAGE=$(go tool cover -func=coverage | tail -n 1 | tr -s '\\t' | cut -f 3)\" \u003e\u003e $GITHUB_OUTPUT\n          go tool cover -html=coverage -o=coveragereport.html\n\n      - name: Publish code coverage badge (and optional report)\n        if: runner.os != 'Windows'\n        uses: linkdata/gitcoverage@v3\n        with:\n          coverage: ${{ steps.coverage.outputs.coverage }}\n          report:   \"coveragereport.html\"\n```\n\nTag workflow example with explicit source branch:\n\n```yml\n- name: Publish code coverage badge from tag build\n  uses: linkdata/gitcoverage@v3\n  with:\n    coverage: \"91%\"\n    branch:   \"release/1.x\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdata%2Fgitcoverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkdata%2Fgitcoverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdata%2Fgitcoverage/lists"}