Code Monkey home page Code Monkey logo

action_slack-notify's Introduction

test notification-check

action_slack-notify

Slackへのワークフロー結果通知アクション

Usage Samples

Default Style

- uses: mm0202/action_slack-notify@master
  if: always()
  env:
    SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

Image from Gyazo

デフォルトスタイル。リポジトリや実行されたワークフローへのリンクなどを表示。

Variables Check Style

- uses: mm0202/action_slack-notify@master
  if: always()
  with:
    style: "variables-check"
  env:
    SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

コード中で使用可能な変数の確認用スタイル。アクション開発時の確認用。

Custom Payload / merge payload & prepend attachments

- uses: mm0202/action_slack-notify@master
  if: always()
  with:
    payload: |
      {
        "text": "${{ job.status }}:bangbang:",
        "attachments": [{
          "fields": [{
            "title": "Repository",
            "value": "${{ github.repository }}"
          }]
        }]
      }
    customPayloadMode: "merge"
    customAttachmentMode: "prepend"
  env:
    SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

Image from Gyazo

customPayloadMode: "merge"

payloadに指定の無い項目は、スタイルの設定を適用。

customAttachmentMode: "prepend"

attachmentsで指定の内容は、スタイルのattachmentの前に追加。

Custom Payload / overwrite payload

- uses: mm0202/action_slack-notify@master
  if: always()
  with:
    payload: |
      {
        "text": "${{ job.status }}:bangbang:",
        "attachments": [{
          "fields": [{
            "title": "Ref",
            "value": "${{ github.ref }}"
          }]
        }]
      }
    customPayloadMode: "overwrite"
  env:
    SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

Image from Gyazo

customPayloadMode: "overwrite"

payloadの指定で上書き。スタイルの設定は無視。

Contexts

payloadの設定で使用可能な変数は以下を参照してください。

Context and expression syntax for GitHub Actions

inputs

style

value default description
default o Default Styleを参照
variables-check - Variables Check Styleを参照

payload

カスタムpayload。デフォルトは"{}"

customPayloadMode

value default description
merge o スタイルのpayloadとマージ
overwrite - スタイルのpayloadを上書き

customAttachmentMode

value default description
append o スタイルのattachmentの後に追加
prepend - スタイルのattachmentの前の追加
overwrite - スタイルのattachmentsを上書き

status

デフォルトはjob.statusの値を使用。特別な場合を除き、ワークフローでの設定は必要なし。

outputs

result

アクションの結果

action_slack-notify's People

Contributors

mm0202 avatar

Watchers

 avatar

action_slack-notify's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.