Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ This action automatically analyzes your Allure Report data and creates rich PR c
- **Test Statistics**: Complete breakdown of test results including passed, failed, broken, skipped, and unknown tests
- **Visual Indicators**: Pie charts and status icons for quick visual assessment
- **Special Test Categories**: Identification of new tests, flaky tests, and retry attempts
- **Clickable Counts**: When a `remote-href` is configured (or a `remoteHref` is present in your `summary.json`), the New / Flaky / Retry numbers in the summary table become links that open the hosted report pre-filtered to that category
- **Collapsible Section Comments**: Opt-in per-category comments (`sections: new,flaky,retry` or `sections: all`) that list the individual tests in each category inside a collapsible `<details>` block, posted alongside the summary table. Stale section comments are cleaned up automatically when the underlying category becomes empty
- **Multi-Environment Quality Gates**: Supports both the legacy flat-array quality-gate format and the newer environment-keyed object format (`{ "prod": [...], "staging": [...] }`)
- **Remote Report Integration**: Automatic linking to Allure Service hosted reports when configured
- **Quality Gate Validation**: Creates GitHub check runs based on quality gate results

Expand Down Expand Up @@ -49,7 +52,9 @@ Add this action to your workflow after your test execution step:
| Input | Description | Required | Default |
|-------|-------------|----------|---------|
| `report-directory` | Directory path containing Allure Report data | No | `./allure-report` |
| `remote-href` | Base URL where the published Allure report is hosted (e.g. GitHub Pages). Used to render `View` links and per-summary links in the PR comment. | No | `""` |
| `github-token` | GitHub token for PR comment operations | No | `${{ github.token }}` |
| `sections` | Optional collapsible section comments to publish alongside the summary table. Supported values: `new`, `flaky`, `retry`, or `all`. Accepts comma- or newline-separated values. | No | `""` |

### Allure Configuration

Expand Down Expand Up @@ -126,9 +131,12 @@ jobs:

1. **Scans Report Directory**: The action searches for `summary.json` files in the specified directory
2. **Parses Test Data**: Reads and processes all discovered summary files
3. **Quality Gate Check**: If `quality-gate.json` exists, creates a GitHub check run with validation results
4. **Creates PR Comment**: Generates a markdown table with test statistics and posts it to the pull request
5. **Updates Existing Comments**: Uses a unique marker to update existing comments instead of creating duplicates
3. **Resolves Per-Summary Remote Links**: For each `summary.json`, derives a hosted-report URL. If `remote-href` is set and an `index.html` sits next to the summary, the relative subdirectory is appended so each report row points at its own published page
4. **Quality Gate Check**: If `quality-gate.json` exists, creates a GitHub check run with validation results (handles both array and environment-keyed object formats)
5. **Creates PR Comment**: Generates a markdown table with test statistics and posts it to the pull request. New / Flaky / Retry cells become filter-links when a remote URL is available
6. **Posts Section Comments**: For each section requested via the `sections` input that has at least one matching test, posts an additional collapsible comment listing those tests. Each section comment carries a unique marker per `(section, summary)` pair so it can be updated in place on subsequent runs
7. **Cleans Up Stale Sections**: Section comments from previous runs whose category is now empty (or no longer requested) are deleted to keep the PR tidy
8. **Updates Existing Comments**: Uses unique markers to update existing comments instead of creating duplicates

## Output Example

Expand Down
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ inputs:
description: "Path to the directory containing generated Allure report data files (summary.json and quality-gate.json)"
required: false
default: "./allure-report"
remote-href:
description: "Base URL where the published Allure report is hosted (e.g. GitHub Pages). Used to render `View` links and per-summary links in the PR comment."
required: false
default: ""
github-token:
description: "GitHub authentication token used for posting comments to pull requests and creating check runs"
required: false
default: "${{ github.token }}"
sections:
description: "Optional collapsible section comments to publish alongside the summary table. Supported values: `new`, `flaky`, `retry`, or `all`. Accepts comma- or newline-separated values."
required: false
default: ""

runs:
using: "node24"
Expand Down
Loading
Loading