Skip to content
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 used to create checks and post comments in pull requests
    # Defaults to ${{ github.token }}
    github-token: ${{ github.token }}
    # Optional pull request number for non-pull_request workflows
    # See "Non-pull request workflows" for issue_comment head SHA lookup
    # Default: ""
    pr-number: ""
    # Optional commit SHA for checks when pr-number is used
    # Default: current GitHub context SHA
    head-sha: ""
    # 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.

Non-pull request workflows

For workflows triggered by events such as issue_comment, workflow_dispatch, or workflow_run, pass pr-number so the action knows which Pull Request should receive comments. Pass head-sha when checks should be attached to the PR head commit instead of the triggering event SHA.

For issue_comment, ${{ github.sha }} points to the default branch, not the pull request head. Resolve the PR head SHA explicitly before passing it to the action:

on:
  issue_comment:
    types: [created]

jobs:
  report:
    if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/run-tests') }}
    permissions:
      pull-requests: write
      checks: write
    steps:
      - name: Resolve pull request head
        id: pr
        env:
          GH_TOKEN: ${{ github.token }}
          PR_NUMBER: ${{ github.event.issue.number }}
        run: |
          head_sha="$(gh pr view "$PR_NUMBER" --json headRefOid --jq .headRefOid)"
          echo "head-sha=$head_sha" >> "$GITHUB_OUTPUT"

      - uses: allure-framework/allure-action@v0
        with:
          report-directory: "./allure-report"
          github-token: ${{ github.token }}
          pr-number: ${{ github.event.issue.number }}
          head-sha: ${{ steps.pr.outputs.head-sha }}

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

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

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

14 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages