Skip to content

Commit

Permalink
Merge branch 'master' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
8398a7 committed Aug 15, 2019
2 parents d41eef3 + d75f152 commit 8c9e775
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checkin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
&& exit 1)
- uses: 8398a7/action-slack@v1
with:
type: failed
type: failure
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Failed Check
uses: 8398a7/action-slack@v1
with:
type: failed
type: failure
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Custom Field Check
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ See [action.yml](action.yml)
```yaml
- uses: 8398a7/action-slack@v1
with:
type: failed
type: failure
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
```
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: You can notify slack of GitHub Actions.
author: 8398a7
inputs:
type:
description: success or failed
description: success or failure
payload:
description: 'json payload(refs: https://github.com/slackapi/node-slack-sdk/blob/v5.0.0/packages/webhook/src/IncomingWebhook.ts#L91-L106)'
runs:
Expand Down
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as core from '@actions/core';
import { Send, successPayload, failedPayload } from './slack';
import { Send, successPayload, failurePayload } from './slack';
import { IncomingWebhookSendArguments } from '@slack/webhook';

async function run() {
Expand All @@ -11,8 +11,8 @@ async function run() {
case 'success':
payload = successPayload();
break;
case 'failed':
payload = failedPayload();
case 'failure':
payload = failurePayload();
break;
default:
payload = JSON.parse(core.getInput('payload'));
Expand Down
2 changes: 1 addition & 1 deletion src/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function successPayload() {
return payload;
}

export function failedPayload() {
export function failurePayload() {
const payload: IncomingWebhookSendArguments = successPayload();
payload.text = 'Failed Workflow';
if (payload.attachments !== undefined) {
Expand Down

0 comments on commit 8c9e775

Please sign in to comment.