Skip to content

Github Action to send XUnit results to Slack ๐ŸŽ™๏ธ๐ŸŽ™๏ธ๐ŸŽ™๏ธ

License

Notifications You must be signed in to change notification settings

yuraku/xunit-slack-reporter

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

93 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

xUnit Slack Reporter

GitHub MarketplaceCIcodecov

Github Action to send xUnit results to Slack.

What it does!

This action will:

  • Parse a xUnit-style XML report.
  • Send summary to Slack workspace & channel of your choice.
  • Supports paths and globs (i.e. **/*.xml)!
  • (Optional) Only send notifications if errors or failures are found.
  • (Optional) Fail the build if errors or failures are found.

What you need!

Setting up the action

The following environment variables are supported:

Environment Variable Example Description Required?
XUNIT_PATH ./results.xml Path (relative to workspce directory) to xUnit report Y*
XUNIT_GLOB **/*.xml Glob (relative to workspace directory) to xUnit reports Y*
SLACK_TOKEN (See Slack documentation) Slack bot user token Y
SLACK_CHANNEL CKQ7C7KJN Unique ID of slack channel to notify Y
SLACK_MESSAGE_TITLE Test Result reporter The title of the message posted in Slack N
EXIT_CODE_FROM_REPORT True/False If present, will fail workflow if errors or failures are in the report N
ONLY_NOTIFY_ON_ISSUES True/False If present, will only send notifications if errors or failures are found N

* = Either XUNIT_PATH or XUNIT_GLOB must be provided.

Sample Workflow section:

    - name: notify-tests
      uses: ivanklee86/[email protected]
      env:
        EXIT_CODE_FROM_REPORT: "True"
        SLACK_CHANNEL: CKQ7C7KJN
        SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
        XUNIT_PATH: ./results.xml
    - name: notify-tests
      uses: ivanklee86/[email protected]
      env:
        ONLY_NOTIFY_ON_ISSUES: "True"
        SLACK_CHANNEL: CKQ7C7KJN
        SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
        SLACK_MESSAGE_TITLE: Core Unit Test Report
        XUNIT_PATH: **/*.xml

About

Github Action to send XUnit results to Slack ๐ŸŽ™๏ธ๐ŸŽ™๏ธ๐ŸŽ™๏ธ

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 81.0%
  • Makefile 9.8%
  • Dockerfile 8.8%
  • Shell 0.4%