Skip to content

Commit 90eb047

Browse files
authored
Add comments sections (#52)
1 parent 939c694 commit 90eb047

19 files changed

Lines changed: 1644 additions & 347 deletions

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
report-directory: "./out/allure-report"
6363
remote-href: "https://allure-framework.github.io/allure-action/${{ steps.path.outputs.subdir }}"
6464
github-token: ${{ secrets.GITHUB_TOKEN }}
65+
sections: "all"
6566

6667
- name: Deploy to GitHub Pages
6768
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
This actions scans given report directory for data and posts a summary comment that includes:
1818

1919
- Summary statistics about all test results
20-
- New, flaky and retry tests
20+
- Counts for new, flaky and retry tests
21+
- Optional collapsible section comments for new, flaky and retry tests
2122
- Adds remote report link if the report has been published to the Allure Service
2223

2324
## Usage
@@ -49,6 +50,12 @@ Then, add the action to your workflow right after your tests, which produce Allu
4950
remote-href: "https://allure-framework.github.io/allure-action/"
5051
# Github Token that uses for posting the comments in Pull Requests
5152
github-token: ${{ secrets.GITHUB_TOKEN }}
53+
# Optional extra section comments to publish alongside the summary table
54+
# Supported values: new, flaky, retry, all
55+
# Default: hidden
56+
sections: |
57+
new
58+
flaky
5259
```
5360
5461
If everything is set up correctly and required reports data is present, the Action will post a comment with Allure Report summary to your Pull Request, like this:
@@ -59,6 +66,33 @@ If everything is set up correctly and required reports data is present, the Acti
5966
6067
The action utilizes Allure 3 Runtime configuration file (`allurerc.js` or `allurerc.mjs`) and use `output` field as a path, where it should search for the generated reports.
6168

69+
### Comment sections
70+
71+
By default, the action posts the summary table only. You can enable additional section comments in the Pull Request with the `sections` input:
72+
73+
```yaml
74+
with:
75+
sections: |
76+
new
77+
flaky
78+
```
79+
80+
Supported values:
81+
82+
- `new`
83+
- `flaky`
84+
- `retry`
85+
- `all`
86+
87+
The input accepts comma-separated or newline-separated values.
88+
89+
When enabled:
90+
91+
- each section is published as a separate comment
92+
- section comments are wrapped in a collapsible `<details>` block
93+
- comments are updated on the next run using dedicated markers
94+
- oversized test lists are truncated and include a `More` link to the filtered remote report when available
95+
6296
### Remote reports
6397

6498
If you want to be able to open remote reports automatically hosted on Allure Service, provide `allureService` configuration to the `allurerc.js` configuration file:

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
description: "GitHub token for creating comments"
1919
required: false
2020
default: "${{ github.token }}"
21+
sections:
22+
description: "Optional collapsible section comments to publish alongside the summary table. Supported values: `new`, `flaky`, `retry`, or `all`. Accepts comma- or newline-separated values."
23+
required: false
24+
default: ""
2125

2226
runs:
2327
using: "node24"

0 commit comments

Comments
 (0)