Skip to content

Commit

Permalink
Merge branch 'master' into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
8398a7 committed Sep 12, 2019
2 parents 9da986b + bf0738c commit ece8049
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ refs: https://api.slack.com/reference/messaging/payload

### Notification

<img width="436" alt="success" src="https://user-images.githubusercontent.com/8043276/63348255-dd2f8a80-c393-11e9-8890-02be1c502f08.png">
<img width="495" alt="success" src="https://user-images.githubusercontent.com/8043276/64783194-242f2b00-d5a2-11e9-836c-7a8a4a8b46ae.png">

```yaml
- uses: 8398a7/action-slack@v2
Expand All @@ -36,7 +36,12 @@ refs: https://api.slack.com/reference/messaging/payload
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
if: always()
if: always() # Pick up events even if the job fails or is canceled.
```
When adding to text, write as follows.
```yaml
- uses: 8398a7/action-slack@v2
with:
type: ${{ job.status }}
Expand All @@ -46,8 +51,15 @@ refs: https://api.slack.com/reference/messaging/payload
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
```
In case of failure or cancellation, you will be notified as follows.
<img width="489" alt="failure" src="https://user-images.githubusercontent.com/8043276/64783230-42952680-d5a2-11e9-9b92-fafcf3a27353.png">
<img width="483" alt="cancelled" src="https://user-images.githubusercontent.com/8043276/64783296-6a848a00-d5a2-11e9-9b4d-7e00d1d8482d.png">
### Custom Notification
Use `status: custom` if you want to send an arbitrary payload.

<img width="395" alt="custom" src="https://user-images.githubusercontent.com/8043276/63348375-0fd98300-c394-11e9-99dc-6cd78fef2d98.png">

```yaml
Expand Down Expand Up @@ -94,9 +106,9 @@ Currently the field is fixed, but I want to make it selectable.
It is assumed that the input is in csv format.

```yaml
- uses: 8398a7/action-slack@v1
- uses: 8398a7/action-slack@v2
with:
type: success
status: ${{ job.status }}
fields: repo,message,action,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
Expand Down

0 comments on commit ece8049

Please sign in to comment.