> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# tadashi0713/flaky-tests-notify

You can notify(slack) flaky tests of your project, so that you can find and fix them quickly.


## Commands

### notify

Collect flaky tests via API, and notify to Slack channel.
The environment variables CIRCLE_TOKEN, SLACK_ACCESS_TOKEN, and SLACK_DEFAULT_CHANNEL must be set for this orb to work.
Please refer to this document how to generate SLACK_ACCESS_TOKEN: https://github.com/CircleCI-Public/slack-orb/wiki/Setup.
Please refer to this document how to generate CIRCLE_TOKEN: https://circleci.com/docs/managing-api-tokens.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `channel` | string | $SLACK_DEFAULT_CHANNEL | Select which channel in which to post to. Channel name or ID will work. You may include a comma separated list of channels if you wish to post to multiple channels at once. Set the "SLACK_DEFAULT_CHANNEL" environment variable for the default channel.
 |
| `circle_token` | string | $CIRCLE_TOKEN | CircleCI token for fetching flaky tests via API. If not specified, CIRCLE_TOKEN environment variable will be used. Please refer to this document how to generate it. https://circleci.com/docs/managing-api-tokens (requires a v2 token)
 |
| `project_slug` | string |  | Example: gh/CircleCI-Public/api-preview-docs. Project slug in the form vcs-slug/org-name/repo-name. If not specified, current project's slug will be used.
 |

## Jobs

### notify

Collect flaky tests via API, and notify to Slack channel.
The environment variables CIRCLE_TOKEN, SLACK_ACCESS_TOKEN, and SLACK_DEFAULT_CHANNEL must be set for this orb to work.
Please refer to this document how to generate SLACK_ACCESS_TOKEN: https://github.com/CircleCI-Public/slack-orb/wiki/Setup.
Please refer to this document how to generate CIRCLE_TOKEN: https://circleci.com/docs/managing-api-tokens.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `channel` | string | $SLACK_DEFAULT_CHANNEL | Select which channel in which to post to. Channel name or ID will work. You may include a comma separated list of channels if you wish to post to multiple channels at once. Set the "SLACK_DEFAULT_CHANNEL" environment variable for the default channel.
 |
| `circle_token` | string | $CIRCLE_TOKEN | CircleCI token for fetching flaky tests via API. If not specified, CIRCLE_TOKEN environment variable will be used. Please refer to this document how to generate it. https://circleci.com/docs/managing-api-tokens (requires a v2 token)
 |
| `project_slug` | string |  | Example: gh/CircleCI-Public/api-preview-docs. Project slug in the form vcs-slug/org-name/repo-name. If not specified, current project's slug will be used.
 |

## Executors

### default

cimg/base docker executor


| Parameter | Type | Default | Description |
|---|---|---|---|
| `tag` | string | stable | Pick a specific cimg/base image variant: https://hub.docker.com/r/cimg/base/tags
 |

## Examples

### notify

This example uses Scheduled Pipelines in order to run this job periodically and find flaky tests faster.
About Scheduled Pipelines: https://circleci.com/docs/scheduled-pipelines


```yaml
version: '2.1'
orbs:
  flaky-tests-notify: tadashi/flaky-tests-notify@1.0.2
workflows:
  notify_flaky_tests:
    jobs:
      - flaky-tests-notify/notify
    when: << pipeline.parameters.notify_flaky_tests >>
```