Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/quipper/slack-notification-action

Notify workflow run of GitHub Actions to Slack
https://github.com/quipper/slack-notification-action

github-actions slack

Last synced: 5 days ago
JSON representation

Notify workflow run of GitHub Actions to Slack

Awesome Lists containing this project

README

        

# slack-notification-action [![ts](https://github.com/quipper/slack-notification-action/actions/workflows/ts.yaml/badge.svg)](https://github.com/quipper/slack-notification-action/actions/workflows/ts.yaml)

This is an action to notify a status of GitHub Actions to a Slack channel.

## Example

image

## Getting Started

To nofity a failure of workflow run on `main` branch,

```yaml
name: slack-notification

on:
workflow_run:
workflows:
- '**'
# you can exclude some workflows, like:
# - '!*-metrics'
branches:
- main
types:
- completed

jobs:
send:
if: github.event.workflow_run.conclusion == 'failure'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: quipper/slack-notification-action@v2
with:
slack-channel-id: ABCDEF123 # your Slack channel ID
slack-app-token: ${{ secrets.SLACK_APP_TOKEN }}
```

You need to set up your Slack App.
See https://github.com/slackapi/slack-github-action for details.

## Specification

This action ignores an event if the conclusion is cancelled or skipped.

When this action is run on `workflow_run` event, it inspects the target workflow run.
Otherwise, it inspects the current workflow run.

### Inputs

| Name | Default | Description |
| ---------------------------------- | --------------- | -------------------------------------------------------------------------------------- |
| `slack-channel-id` | (required) | ID of the Slack channel |
| `slack-app-token` | (dry-run) | Bot token of Slack App |
| `github-token` | `github.token` | GitHub token |
| `lost-communication-error-message` | See action.yaml | Message to send when "The self-hosted runner lost communication with the server" error |

### Outputs

None.