A GitHub Action that integrates Allure Report 3 directly into your pull request workflow by posting comprehensive test summaries as comments.
This action automatically analyzes your Allure Report data and creates rich PR comments containing:
- 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
- Remote Report Integration: Automatic linking to Allure Service hosted reports when configured
- Quality Gate Validation: Creates GitHub check runs based on quality gate results
Ensure your workflow has the necessary permissions:
permissions:
pull-requests: write
checks: writeAdd this action to your workflow after your test execution step:
- name: Execute test suite
run: |
# Your test commands that generate Allure Report data
- name: Post Allure Report Summary
uses: step-security/allure-report-action@v1
with:
report-directory: "./allure-report"
github-token: ${{ secrets.GITHUB_TOKEN }}| Input | Description | Required | Default |
|---|---|---|---|
report-directory |
Directory path containing Allure Report data | No | ./allure-report |
github-token |
GitHub token for PR comment operations | No | ${{ github.token }} |
This action reads configuration from your allurerc.js or allurerc.mjs file. The output field specifies where to look for generated reports.
import { defineConfig } from "allure";
export default defineConfig({
output: "allure-report",
});To enable automatic linking to reports hosted on Allure Service, add the allureService configuration:
import { defineConfig } from "allure";
import { env } from "node:process";
export default defineConfig({
output: "allure-report",
allureService: {
url: env.ALLURE_SERVICE_URL,
project: env.ALLURE_SERVICE_PROJECT,
accessToken: env.ALLURE_SERVICE_ACCESS_TOKEN,
}
});name: Test Suite with Allure Report
on:
pull_request:
branches: [ main ]
permissions:
pull-requests: write
checks: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup test environment
run: |
# Setup commands
- name: Run tests
run: |
# Test execution that generates Allure data
- name: Generate Allure Report
run: |
# Generate report command
- name: Post Allure Summary
uses: step-security/allure-report-action@v1
with:
report-directory: "./allure-report"
github-token: ${{ secrets.GITHUB_TOKEN }}- Scans Report Directory: The action searches for
summary.jsonfiles in the specified directory - Parses Test Data: Reads and processes all discovered summary files
- Quality Gate Check: If
quality-gate.jsonexists, creates a GitHub check run with validation results - Creates PR Comment: Generates a markdown table with test statistics and posts it to the pull request
- Updates Existing Comments: Uses a unique marker to update existing comments instead of creating duplicates
The action creates a comment in your pull request similar to this:
| Name | Duration | Stats | New | Flaky | Retry | Report | |
|---|---|---|---|---|---|---|---|
| 🥧 | Test Suite | 2m 30s | ✅ 45 ❌ 2 |
5 | 2 | 1 | View |
npm install
npm run buildnpm testnpm run devMIT License - See LICENSE file for details