{"id":50006411,"url":"https://github.com/actions/upload-code-coverage","last_synced_at":"2026-05-19T18:01:24.724Z","repository":{"id":358270949,"uuid":"1220171870","full_name":"actions/upload-code-coverage","owner":"actions","description":"Upload code coverage report from your GitHub Actions workflow","archived":false,"fork":false,"pushed_at":"2026-05-15T15:30:35.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-16T16:27:09.057Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/actions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-24T16:10:08.000Z","updated_at":"2026-05-15T15:13:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/actions/upload-code-coverage","commit_stats":null,"previous_names":["actions/upload-code-coverage"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/actions/upload-code-coverage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions%2Fupload-code-coverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions%2Fupload-code-coverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions%2Fupload-code-coverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions%2Fupload-code-coverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/actions","download_url":"https://codeload.github.com/actions/upload-code-coverage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions%2Fupload-code-coverage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33161565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-05-19T18:01:18.956Z","updated_at":"2026-05-19T18:01:24.703Z","avatar_url":"https://github.com/actions.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Upload Code Coverage\n\nUpload a Cobertura XML coverage report to GitHub's code coverage API.\n\n## Usage\n\n```yaml\n- uses: actions/upload-code-coverage@v1\n  with:\n    file: cobertura.xml\n    language: Java\n    label: code-coverage/jacoco\n```\n\nThe action handles everything else automatically: gzip/base64 encoding, resolving the correct commit SHA and ref, detecting PR number (from both `pull_request` and `push` events), and calling the upload API.\n\n## Inputs\n\n| Input | Required | Description |\n|-------|----------|-------------|\n| `file` | Yes | Path to the Cobertura XML coverage report |\n| `language` | Yes | Linguist language name (e.g. `Java`, `Go`, `Python`) |\n| `label` | Yes | Label for the report (e.g. `code-coverage/jacoco`) |\n| `token` | No | GitHub token (defaults to `github.token`) |\n\n## Permissions\n\nThe calling workflow or job must grant `code-quality: write`. The action cannot declare this itself.\n\n```yaml\npermissions:\n  contents: read\n  code-quality: write\n```\n\nFor push-only workflows where the action looks up PR numbers via `gh pr list`, also add `pull-requests: read`.\n\n## Event handling\n\nThe action auto-detects the event type and resolves the correct values:\n\n- **`pull_request` / `pull_request_target`**: Uses the PR head SHA and ref (not the merge commit), and includes the PR number.\n- **`push`**: Uses `github.sha` and `github.ref`, and looks up whether the branch has an open PR via `gh pr list`.\n\nThis means it works with both patterns — workflows triggered by `pull_request` and push-only workflows that serve PRs via branch pushes.\n\n## Full example (separate upload job)\n\n```yaml\nname: CI\n\non:\n  push:\n    branches: [main]\n  pull_request:\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          ref: ${{ github.event.pull_request.head.sha || github.sha }}\n\n      # ... build and generate cobertura.xml ...\n\n      - uses: actions/upload-artifact@v4\n        if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository\n        with:\n          name: cobertura-report\n          path: cobertura.xml\n\n  upload-coverage:\n    needs: build\n    if: ${{ !cancelled() \u0026\u0026 needs.build.result == 'success' \u0026\u0026 (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      code-quality: write\n    steps:\n      - uses: actions/download-artifact@v4\n        with:\n          name: cobertura-report\n\n      - uses: actions/upload-code-coverage@v1\n        with:\n          file: cobertura.xml\n          language: Java\n          label: code-coverage/jacoco\n```\n\n## Caveats\n\n- **Fork PRs are not supported.** Pull requests from forks don't have write access to the base repository, so the action cannot upload coverage. When a fork PR is detected, the action exits gracefully with a notice — it won't fail your CI.\n- **Merge queue runs are skipped.** Coverage should be uploaded for PRs and the default branch, making merge queue uploads unnecessary. The action logs a warning and exits successfully.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factions%2Fupload-code-coverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factions%2Fupload-code-coverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factions%2Fupload-code-coverage/lists"}