Skip to content

allure-framework/allure-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Allure Action

GitHub action to render Allure Report summary right in your Pull Requests

Allure Report logo


Overview

This actions scans given report directory for data and posts a summary comment that includes:

  • Summary statistics about all test results
  • Counts for new, flaky and retry tests
  • Optional collapsible section comments for new, flaky and retry tests
  • Adds remote report link if the report has been published to the Allure Service

Usage

Add pull-requests and checks permissions to your workflow to make possible posting comments to Pull Requests:

permissions:
  pull-requests: write
  checks: write

Then, add the action to your workflow right after your tests, which produce Allure Report:

- name: Run tests
  run |-
    # run your tests that generate Allure Report data
     
- name: Run Allure Action
  uses: allure-framework/allure-action@v0 # update with latest version tag
  with:
    # Path to the generated report directory
    # Default: "./allure-report"
    report-directory: "./"
    # State path where the report is hosted on
    # Useful when you publish your report to GitHub pages or any other hosting for static web-sites
    # Default: ""
    remote-href: "https://allure-framework.github.io/allure-action/"
    # Github Token that uses for posting the comments in Pull Requests
    github-token: ${{ secrets.GITHUB_TOKEN }}
    # Optional extra section comments to publish alongside the summary table
    # Supported values: new, flaky, retry, all
    # Default: hidden
    sections: |
      new
      flaky

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:

image

Configuration

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.

Comment sections

By default, the action posts the summary table only. You can enable additional section comments in the Pull Request with the sections input:

with:
  sections: |
    new
    flaky

Supported values:

  • new
  • flaky
  • retry
  • all

The input accepts comma-separated or newline-separated values.

When enabled:

  • each section is published as a separate comment
  • section comments are wrapped in a collapsible <details> block
  • comments are updated on the next run using dedicated markers
  • oversized test lists are truncated and include a More link to the filtered remote report when available

Remote reports

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

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,
+  }
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors