Provides the function of slack notification to GitHub Actions.
Перейти к файлу
8398a7 945ecb26ea
bump 3.8.0
2020-10-03 17:11:50 +09:00
.github [#115] fixed the integration test for pre 2020-10-03 16:59:03 +09:00
__tests__
docs [#115] remove unnecessary items 2020-10-03 17:00:02 +09:00
scripts
src
.eslintignore
.eslintrc.json
.gitignore
.prettierignore
.prettierrc.json
LICENSE
README.md
action.yml
codecov.yml
jest.config.js
package-lock.json bump 3.8.0 2020-10-03 17:11:50 +09:00
package.json bump 3.8.0 2020-10-03 17:11:50 +09:00
tsconfig.json

README.md

action-slack

codecov

Quick Start

You can learn more about it here.

steps:
  - uses: 8398a7/action-slack@v3
    with:
      status: ${{ job.status }}
      fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
    env:
      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
    if: always() # Pick up events even if the job fails or is canceled.
success

Custom Formats of your choice

You can learn more about it here.

steps:
  - uses: 8398a7/action-slack@v3
  with:
    status: custom
    fields: workflow,job,commit,repo,ref,author,took
    custom_payload: |
      {
        username: 'action-slack',
        icon_emoji: ':octocat:',
        attachments: [{
          color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
          text: `${process.env.AS_WORKFLOW}\n${process.env.AS_JOB} (${process.env.AS_COMMIT}) of ${process.env.AS_REPO}@${process.env.AS_REF} by ${process.env.AS_AUTHOR} succeeded in ${process.env.AS_TOOK}`,
        }]
      }      
  env:
    SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
custom