{"id":14986023,"url":"https://github.com/mikepenz/action-junit-report","last_synced_at":"2025-05-14T23:07:39.089Z","repository":{"id":36969282,"uuid":"330384746","full_name":"mikepenz/action-junit-report","owner":"mikepenz","description":"Reports junit test results as GitHub Pull Request Check","archived":false,"fork":false,"pushed_at":"2025-04-28T06:57:15.000Z","size":14921,"stargazers_count":360,"open_issues_count":9,"forks_count":140,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-14T16:44:01.068Z","etag":null,"topics":["actions","automation","cd","ci","github-actions","hacktoberfest","junit","test","test-automation","workflow"],"latest_commit_sha":null,"homepage":"https://blog.mikepenz.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikepenz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["mikepenz"]}},"created_at":"2021-01-17T12:21:42.000Z","updated_at":"2025-05-07T01:46:23.000Z","dependencies_parsed_at":"2024-03-13T15:58:47.596Z","dependency_job_id":"4be2d5ba-ce7c-43de-845e-142474f688ad","html_url":"https://github.com/mikepenz/action-junit-report","commit_stats":{"total_commits":596,"total_committers":26,"mean_commits":"22.923076923076923","dds":0.4815436241610739,"last_synced_commit":"34f4f0daa6b03aee5efc77b9c2cbc51a75781341"},"previous_names":[],"tags_count":88,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikepenz%2Faction-junit-report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikepenz%2Faction-junit-report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikepenz%2Faction-junit-report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikepenz%2Faction-junit-report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikepenz","download_url":"https://codeload.github.com/mikepenz/action-junit-report/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243362,"owners_count":22038046,"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","automation","cd","ci","github-actions","hacktoberfest","junit","test","test-automation","workflow"],"created_at":"2024-09-24T14:12:09.262Z","updated_at":"2025-05-14T23:07:34.079Z","avatar_url":"https://github.com/mikepenz.png","language":"TypeScript","funding_links":["https://github.com/sponsors/mikepenz"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  :octocat:\n\u003c/div\u003e\n\u003ch1 align=\"center\"\u003e\n  action-junit-report\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    ... reports JUnit test results as GitHub pull request check.\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\".github/images/action.png\"/\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/mikepenz/action-junit-report\"\u003e\n\t\t\u003cimg src=\"https://github.com/mikepenz/action-junit-report/workflows/CI/badge.svg\"/\u003e\n\t\u003c/a\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\n-------\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"#whats-included-\"\u003eWhat's included 🚀\u003c/a\u003e \u0026bull;\n    \u003ca href=\"#setup\"\u003eSetup 🛠️\u003c/a\u003e \u0026bull;\n    \u003ca href=\"#sample-%EF%B8%8F\"\u003eSample 🖥️\u003c/a\u003e \u0026bull;\n    \u003ca href=\"#contribute-\"\u003eContribute 🧬\u003c/a\u003e \u0026bull;\n    \u003ca href=\"#license\"\u003eLicense 📓\u003c/a\u003e\n\u003c/p\u003e\n\n-------\n\n### What's included 🚀\n\n- Flexible JUnit parser with wide support\n- Supports nested test suites\n- Blazingly fast execution\n- Lighweight\n- Rich build log output\n\nThis action processes JUnit XML test reports on pull requests and shows the result as a PR check with summary and\nannotations.\n\nBased on action for [Surefire Reports by ScaCap](https://github.com/ScaCap/action-surefire-report)\n\n## Setup\n\n### Configure the workflow\n\n```yml\nname: build\non:\n  pull_request:\n\njobs:\n  build:\n    name: Build and Run Tests\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Code\n        uses: actions/checkout@v4\n      - name: Build and Run Tests\n        run: # execute your tests generating test results\n      - name: Publish Test Report\n        uses: mikepenz/action-junit-report@v5\n        if: success() || failure() # always run even if the previous step fails\n        with:\n          report_paths: '**/build/test-results/test/TEST-*.xml'\n```\n\n### Inputs\n\n| **Input**                  | **Description**                                                                                                                                                                                     |\n|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `report_paths`             | Optional. [Glob](https://github.com/actions/toolkit/tree/master/packages/glob) expression to junit report paths. Defaults to: `**/junit-reports/TEST-*.xml`.                                        |\n| `token`                    | Optional. GitHub token for creating a check run. Set to `${{ github.token }}` by default.                                                                                                           |\n| `group_reports`            | Optional. Defines if different reports found by a single `report_paths` glob expression are grouped together. Defaults to `true`.                                                                   |\n| `test_files_prefix`        | Optional. Prepends the provided prefix to test file paths within the report when annotating on GitHub.                                                                                              |\n| `exclude_sources`          | Optional. Provide `,` seperated array of folders to ignore for source lookup. Defaults to: `/build/,/__pycache__/`                                                                                  |\n| `check_name`               | Optional. Check name to use when creating a check run. The default is `JUnit Test Report`.                                                                                                          |\n| `suite_regex`              | REMOVED (as of v5). Instead use `check_title_template` and configure: `{{BREAD_CRUMB}}{{SUITE_NAME}}/{{TEST_NAME}}`                                                                                 |\n| `commit`                   | Optional. The commit SHA to update the status. This is useful when you run it with `workflow_run`.                                                                                                  |\n| `fail_on_failure`          | Optional. Fail the build in case of a test failure.                                                                                                                                                 |\n| `fail_on_parse_error`      | Optional. Fail the build if the test report file cannot be parsed.                                                                                                                                 |\n| `require_tests`            | Optional. Fail if no test are found.                                                                                                                                                                |\n| `require_passed_tests`     | Optional. Fail if no passed test are found. (This is stricter than `require_tests`, which accepts skipped tests).                                                                                   |\n| `include_passed`           | Optional. By default the action will skip passed items for the annotations. Enable this flag to include them.                                                                                       |\n| `check_retries`            | Optional. If a testcase is retried, ignore the original failure.                                                                                                                                    |\n| `check_title_template`     | Optional. Template to configure the title format. Placeholders: {{FILE_NAME}}, {{SUITE_NAME}}, {{TEST_NAME}}, {{CLASS_NAME}}, {{BREAD_CRUMB}}.                                                      |\n| `bread_crumb_delimiter`    | Optional. Defines the delimiter characters between the breadcrumb elements. Defaults to: `/`.                                                                                                       |\n| `summary`                  | Optional. Additional text to summary output                                                                                                                                                         |\n| `check_annotations`        | Optional. Defines if the checks will include annotations. If disabled skips all annotations for the check. (This does not affect `annotate_only`, which uses no checks).                            |\n| `update_check`             | Optional. Uses an alternative API to update checks, use for cases with more than 50 annotations. Default: `false`.                                                                                  |\n| `annotate_only`            | Optional. Will only annotate the results on the files, won't create a check run. Defaults to `false`.                                                                                               |\n| `transformers`             | Optional. Array of `Transformer`s offering the ability to adjust the fileName. Defaults to: `[{\"searchValue\":\"::\",\"replaceValue\":\"/\"}]`                                                             |\n| `job_summary`              | Optional. Enables the publishing of the job summary for the results. Defaults to `true`. May be required to disable [Enterprise Server](https://github.com/mikepenz/action-junit-report/issues/637) |\n| `detailed_summary`         | Optional. Include table with all test results in the summary (Also applies to comment). Defaults to `false`.                                                                                        |\n| `flaky_summary`            | Optional. Include table with all flaky results in the summary (Also applies to comment). Defaults to `false`.                                                                                       |\n| `verbose_summary`          | Optional. Detail table will note if there were no test annotations for a test suite (Also applies to comment). Defaults to `true`.                                                                  |\n| `skip_success_summary`     | Optional. Skips the summary table if only successful tests were detected (Also applies to comment). Defaults to `false`.                                                                            |\n| `include_empty_in_summary` | Optional. Include entries in summaries that have 0 count. Defaults to `true`.                                                                                                                       |\n| `include_time_in_summary`  | Optional. Include spent time in summaries. Defaults to `false`.                                                                                                                                     |\n| `simplified_summary`       | Optional. Use icons instead of text to indicate status in summary. Defaults to `false`.                                                                                                             |\n| `group_suite`              | Optional. If enabled, will group the testcases by test suite in the `detailed_summary`. Defaults to `false`.                                                                                        |\n| `comment`                  | Optional. Enables a comment being added to the PR with the summary tables (Respects the summary configuration flags). Defaults to `false`.                                                          |\n| `updateComment`            | Optional. If a prior action run comment exists, it is updated. If disabled, new comments are creted for each run. Defaults to `true`.                                                               |\n| `annotate_notice`          | Optional. Annotate passed test results along with warning/failed ones. Defaults to `false`. (Changed in v3.5.0)                                                                                     |\n| `follow_symlink`           | Optional. Enables to follow symlinks when searching test files via the globber. Defaults to `false`.                                                                                                |\n| `job_name`                 | Optional. Specify the name of a check to update                                                                                                                                                     |\n| `annotations_limit`        | Optional. Specify the limit for annotations. This will also interrupt parsing all test-suites if the limit is reached. Defaults to: `No Limit`.                                                     |\n| `skip_annotations`         | Optional. Setting this flag will result in no annotations being added to the run. Defaults to `false`.                                                                                              |\n| `truncate_stack_traces`    | Optional. Truncate stack traces from test output to 2 lines in annotations. Defaults to `true`.                                                                                                     |\n| `resolve_ignore_classname` | Optional. Force ignore test case classname from the xml report (This can help fix issues with some tools/languages). Defaults to `false`.                                                           |\n| `skip_comment_without_tests` | Optional. Disable commenting if no tests are detected. Defaults to `false`.                                                                                                                           |\n\n### Common Configurations\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eCommon report_paths\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n- Surefire:\n  `**/target/surefire-reports/TEST-*.xml`\n- sbt:\n  `**/target/test-reports/*.xml`\n\n\u003c/p\u003e\n\u003c/details\u003e\n\nIf you observe out-of-memory errors, follow the below configuration suggestion.\n\n\u003e [!TIP]\n\u003e FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eIncrease Node Heap Memory\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\nIf you encounter an out-of-memory from Node, such as\n\n```\nFATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory\n```\n\nyou can increase the memory allocation by setting an environment variable\n\n```yaml\n- name: Publish Test Report\n  uses: mikepenz/action-junit-report@v5\n  env:\n    NODE_OPTIONS: \"--max_old_space_size=4096\"\n  if: success() || failure() # always run even if the previous step fails\n  with:\n    report_paths: '**/build/test-results/test/TEST-*.xml'\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### Action outputs\n\nAfter action execution it will return the test counts as output.\n\n```yml\n# ${{steps.{CHANGELOG_STEP_ID}.outputs.total}}\n```\n\nA full set list of possible output values for this action.\n\n| **Output**                 | **Description**                                                                                                     |\n|----------------------------|---------------------------------------------------------------------------------------------------------------------|\n| `outputs.total`            | The total number of test cases covered by this test-step.                                                           |\n| `outputs.passed`           | The number of passed test cases.                                                                                    |\n| `outputs.skipped`          | The number of skipped test cases.                                                                                   |\n| `outputs.retried`          | The number of retried test cases.                                                                                   |\n| `outputs.failed`           | The number of failed test cases.                                                                                    |\n| `outputs.summary`          | The short summary of the junit report. In html format (as also constructed by GitHub for the summary).              |\n| `outputs.detailed_summary` | The full table with all test results in a summary. In html format (as also constructed by GitHub for the summary).  |\n| `outputs.flaky_summary`    | The full table with all flaky results in a summary. In html format (as also constructed by GitHub for the summary). |\n\n### PR run permissions\n\nThe action requires `write` permission on the checks. If the GA token is `read-only` (this is a repository\nconfiguration) please enable `write` permission via:\n\n```yml\npermissions:\n  checks: write\n  pull-requests: write # only required if `comment: true` was enabled\n```\n\nAdditionally for [security reasons], the github token used for `pull_request` workflows is [marked as read-only].\nIf you want to post checks to a PR from an external repository, you will need to use a separate workflow\nwhich has a read/write token, or use a PAT with elevated permissions.\n\n[security reasons]: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/\n\n[marked as read-only]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n```yml\nname: build\non:\n  pull_request:\n\njobs:\n  build:\n    name: Build and Run Tests\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Code\n        uses: actions/checkout@v3\n      - name: Build and Run Tests\n        run: # execute your tests generating test results\n      - name: Upload Test Report\n        uses: actions/upload-artifact@v3\n        if: always() # always run even if the previous step fails\n        with:\n          name: junit-test-results\n          path: '**/build/test-results/test/TEST-*.xml'\n          retention-days: 1\n\n---\nname: report\non:\n  workflow_run:\n    workflows: [ build ]\n    types: [ completed ]\n\npermissions:\n  checks: write\n\njobs:\n  checks:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Download Test Report\n        uses: dawidd6/action-download-artifact@v2\n        with:\n          name: junit-test-results\n          workflow: ${{ github.event.workflow.id }}\n          run_id: ${{ github.event.workflow_run.id }}\n      - name: Publish Test Report\n        uses: mikepenz/action-junit-report@v5\n        with:\n          commit: ${{github.event.workflow_run.head_sha}}\n          report_paths: '**/build/test-results/test/TEST-*.xml'\n```\n\nThis will securely post the check results from the privileged workflow onto the PR's checks report.\n\n\u003c/p\u003e\n\u003c/details\u003e\n\nIn environments that do not allow `checks: write`, the action can be configured to leverage the annotate\\_only option.\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n```yml\nname: pr\n\non:\n  pull_request:\n\njobs:\n  unit_test:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Code\n        uses: actions/checkout@v4\n\n      - name: Build and Run Tests\n        run: # execute your tests generating test results\n\n      - name: Write out Unit Test report annotation for forked repo\n        if: ${{ failure() \u0026\u0026  (github.event.pull_request.head.repo.full_name != github.repository) }}\n        uses: mikepenz/action-junit-report@v5\n        with:\n          annotate_only: true # forked repo cannot write to checks so just do annotations\n```\n\nThis will selectively use different methods for forked and unforked repos.\n\u003c/p\u003e\n\u003c/details\u003e\n\n## Sample 🖥️\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\".github/images/annotated.png\"/\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\".github/images/annotations.png\"/\u003e\n\u003c/div\u003e\n\n## Contribute 🧬\n\n```bash\n# Install the dependencies  \n$ npm install\n\n# Verify lint is happy\n$ npm run lint -- --fix\n\n# Format\n$ npm run format\n\n# Build the typescript and package it for distribution\n$ npm run build \u0026\u0026 npm run package\n\n# Run the tests, use to debug, and test it out\n$ npm test\n```\n\n### Credits\n\nOriginal idea and GitHub Actions by: https://github.com/ScaCap/action-surefire-report\n\n## Other actions\n\n- [release-changelog-builder-action](https://github.com/mikepenz/release-changelog-builder-action)\n- [xray-action](https://github.com/mikepenz/xray-action/)\n- [jira-release-composition-action](https://github.com/mikepenz/jira-release-composite-action)\n\n## License\n\n    Copyright (C) 2025 Mike Penz\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikepenz%2Faction-junit-report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikepenz%2Faction-junit-report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikepenz%2Faction-junit-report/lists"}