diff --git a/.github/workflows/checkin.yml b/.github/workflows/checkin.yml index 5259f4dc..d456e785 100644 --- a/.github/workflows/checkin.yml +++ b/.github/workflows/checkin.yml @@ -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() diff --git a/.github/workflows/slack.yml b/.github/workflows/slack.yml index e0f30d52..47bc26d5 100644 --- a/.github/workflows/slack.yml +++ b/.github/workflows/slack.yml @@ -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 diff --git a/README.md b/README.md index 6604c9dd..473e39d2 100644 --- a/README.md +++ b/README.md @@ -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 }} ``` diff --git a/action.yml b/action.yml index 5c30e6c5..ccdb61d9 100644 --- a/action.yml +++ b/action.yml @@ -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: diff --git a/src/main.ts b/src/main.ts index 566d228b..e2deb85a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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() { @@ -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')); diff --git a/src/slack.ts b/src/slack.ts index 83d4aef7..41c9062e 100644 --- a/src/slack.ts +++ b/src/slack.ts @@ -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) {