https://github.com/ivanklee86/xunit-slack-reporter
Github Action to send XUnit results to Slack 🎙️🎙️🎙️
https://github.com/ivanklee86/xunit-slack-reporter
actions xunit
Last synced: 19 days ago
JSON representation
Github Action to send XUnit results to Slack 🎙️🎙️🎙️
- Host: GitHub
- URL: https://github.com/ivanklee86/xunit-slack-reporter
- Owner: ivanklee86
- License: mit
- Created: 2019-07-09T17:51:07.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-08-15T05:43:00.000Z (2 months ago)
- Last Synced: 2025-08-15T07:16:46.284Z (2 months ago)
- Topics: actions, xunit
- Language: Python
- Homepage:
- Size: 163 KB
- Stars: 12
- Watchers: 0
- Forks: 8
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-actions - xUnit Slack Reporter: Sends summary of tests from xUnit reports to a Slack channel
- fucking-awesome-actions - xUnit Slack Reporter: Sends summary of tests from xUnit reports to a Slack channel
- awesome-workflows - xUnit Slack Reporter: Sends summary of tests from xUnit reports to a Slack channel
- awesome-actions - 链接
- awesome-actions - 链接
README
# xUnit Slack Reporter
[](https://github.com/marketplace/actions/xunit-slack-reporter)[](https://github.com/ivanklee86/xunit-slack-reporter/actions/workflows/ci.yml)[](https://codecov.io/gh/ivanklee86/xunit-slack-reporter)
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!
- A token for a [Slack bot user](https://api.slack.com/bot-users). I recommend setting up the token as a [secret](https://developer.github.com/actions/managing-workflows/storing-secrets/).
- The [channel ID](https://stackoverflow.com/questions/40940327/what-is-the-simplest-way-to-find-a-slack-team-id-and-a-channel-id) to notify.
## 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 |
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:
```.env
- name: notify-tests
uses: ivanklee86/xunit-slack-reporter@v1.4.0
env:
EXIT_CODE_FROM_REPORT: "True"
SLACK_CHANNEL: CKQ7C7KJN
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
XUNIT_PATH: ./results.xml
```
```.env
- name: notify-tests
uses: ivanklee86/xunit-slack-reporter@v1.4.0
env:
ONLY_NOTIFY_ON_ISSUES: "True"
SLACK_CHANNEL: CKQ7C7KJN
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
XUNIT_PATH: **/*.xml
```