sinlov/woodpecker-feishu-group-robot

By sinlov

Updated over 1 year ago

woodpecker feishu group robot

Image
0

50K+

sinlov/woodpecker-feishu-group-robot repository overview

woodpecker-feishu-group-robot

Features

  • simple to set up and easy to use
  • Supports ignoring build success notifications in the same steps and comparing notifications after the last build failure.
  • internationalization support: en-US, zh-CN more support see --help (v1.4.+)
  • docker platform support
    • linux/amd64 linux/386 linux/arm64/v8 linux/arm/v7 linux/ppc64le linux/s390x (v1.4.+)

before use

  • sed doc at feishu Custom bot guide, to new group robot
  • Configure webhook like https://open.feishu.cn/open-apis/bot/v2/hook/{web_hook} end {web_hook}
    • {web_hook} must settings at settings.feishu-webhookor PLUGIN_FEISHU_WEBHOOK
  • Feishu security settings
    • if set Custom keywords you can change settings.feishu-msg-title or PLUGIN_FEISHU_MSG_TITLE
    • fi set Signature validation by settings.feishu-secret or PLUGIN_FEISHU_SECRET
  • just add .woodpecker_kit.steps.transfer at git ignore

Settings

NameRequiredDefault valueDescription
debugnofalseopen debug log or open by env PLUGIN_DEBUG
feishu-enable-debug-noticenofalsewhen debug open, will not send message, must enable it to notice under debug open
feishu-webhookyesnonefeishu group robot webhook, end of feishu robot https://open.feishu.cn/open-apis/bot/v2/hook/{web_hook}
feishu-secretyesnonefeishu robot secret, just signature verification, empty will not open.
feishu-msg-titleyesCI Notificationfeishu group robot message title, most input Security settings area keywords
feishu-notice-typesnononefeishu notice types, if empty will use [ build_status ]
feishu-msg-i18n-langnoen-USfeishu group robot message i18n lang, support: en-US, zh-CN more support see --help (v1.4.+)
feishu-status-success-ignorenofalseignore this build success status
feishu-status-change-successnofalsemust open [ feishu-status-success-ignore ], when status change to success, compare with CI_PREV_PIPELINE_STATUS
feishu-enable-forwardnofalselet notification card change more info see https://open.feishu.cn/document/ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN

custom settings

NameRequiredDefault valueDescription
feishu-ntp-targetnononelike "pool.ntp.org" if not set will not sync ntp time
feishu-msg-powered-by-image-keynononecard img by feishu-image-key
feishu-msg-powered-by-image-altnononecard img alt tag name

Hide Settings:

NameRequiredDefault valueDescription
timeout_secondno10command timeout setting by second
woodpecker-kit-steps-transfer-file-pathno.woodpecker_kit.steps.transferSteps transfer file path, default by wd_steps_transfer.DefaultKitStepsFileName
woodpecker-kit-steps-transfer-disable-outnofalseSteps transfer write disable out

Example

  • workflow with backend docker

docker hub version semver docker hub image size docker hub image pulls

labels:
  backend: docker
steps:
  notification-feishu-group-robot:
    image: sinlov/woodpecker-feishu-group-robot:latest
    pull: false
    settings:
      # debug: true # plugin debug switch
      # feishu-enable-debug-notice: true when debug open, will not send message, must enable it to notice under debug open
      # feishu-ntp-target: "pool.ntp.org" # if not set will not sync ntp time
      feishu-webhook:
        # https://woodpecker-ci.org/docs/usage/secrets
        from_secret: feishu_group_bot_token
      feishu-secret:
        from_secret: feishu_group_secret_bot
      feishu-msg-i18n-lang: en-US # support: en-US, zh-CN more support see --help (v1.4.+)
      feishu-msg-title: "CI Notification" # default [CI Notification]
      # let notification card change more info see https://open.feishu.cn/document/ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN
      feishu-enable-forward: true
      feishu-status-success-ignore: false # ignore this build success status
      feishu-status-change-success: false # must open [ feishu-status-success-ignore ], when status change to success, compare with CI_PREV_PIPELINE_STATUS
    when:
      status: # only support failure/success,  both open will send anything
        - failure
        - success
  • workflow with backend local, must install at local and effective at evn PATH
go install -a github.com/woodpecker-kit/woodpecker-feishu-group-robot/cmd/woodpecker-feishu-group-robot@latest

GitHub latest SemVer tag) GitHub release)

  • install at ${GOPATH}/bin, v1.0.0
go install -v github.com/woodpecker-kit/woodpecker-feishu-group-robot/cmd/[email protected]
labels:
  backend: local
steps:
  notification-feishu-group-robot:
    image: woodpecker-feishu-group-robot
    settings:
      # debug: true # plugin debug switch
      # feishu-enable-debug-notice: true when debug open, will not send message, must enable it to notice under debug open
      # feishu-ntp-target: "pool.ntp.org" # if not set will not sync ntp time
      feishu-webhook:
        # https://woodpecker-ci.org/docs/usage/secrets
        from_secret: feishu_group_bot_token
      feishu-secret:
        from_secret: feishu_group_secret_bot
      feishu-msg-i18n-lang: en-US # support: en-US, zh-CN more support see --help (v1.4.+)
      feishu-msg-title: "CI Notification" # default [CI Notification]
      # let notification card change more info see https://open.feishu.cn/document/ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN
      feishu-enable-forward: true
      feishu-status-success-ignore: false # ignore this build success status
      feishu-status-change-success: false # must open [ feishu-status-success-ignore ], when status change to success, compare with CI_PREV_PIPELINE_STATUS
    when:
      status: # only support failure/success,  both open will send anything
        - failure
        - success
steps transfer
  • The response needs to enable support for the type corresponding to settings.feishu-notice-types
  • less support version is v1.3.0
With notice type: file_browser

GitHub latest SemVer tag) GitHub release) docker hub version semver

labels:
  backend: docker
steps:
  woodpecker-file-browser-upload:
    image: sinlov/woodpecker-file-browser-upload:latest
    pull: false
    settings:
      # debug: false # plugin debug switch
      file-browser-host: "http://127.0.0.1:80" # must set args, file_browser host like http://127.0.0.1:80
      file-browser-username: # must set args, file_browser username
        # https://woodpecker-ci.org/docs/usage/secrets
        from_secret: file_browser_user_name
      file-browser-user-password: # must set args, file_browser user password
        from_secret: file_browser_user_passwd
      file-browser-remote-root-path: dist/ # must set args, send to file_browser base path
      file-browser-dist-type: git # must set args, type of dist file graph only can use: git, custom
      file-browser-file-glob: # must set args, globs list of send to file_browser under file-browser-target-dist-root-path
        - "**/*.tar.gz"
        - "**/*.sha256"

  notification-feishu-group-robot:
    image: sinlov/woodpecker-feishu-group-robot:latest
    pull: false
    depends_on:
      - woodpecker-file-browser-upload # must depend on woodpecker-file-browser-upload plugin
    settings:
      feishu-webhook:
        # https://woodpecker-ci.org/docs/usage/secrets
        from_secret: feishu_group_bot_token
      feishu-secret:
        from_secret: feishu_group_secret_bot
      feishu-msg-title: "CI Notification" # default [CI Notification]
      # let notification card change more info see https://open.feishu.cn/document/ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN
      feishu-enable-forward: true
      feishu-notice-types:
        - file_browser # after file_browser upload will show file_browser info
        - build_status # also show build status
    when:
      status: # only support failure/success,  both open will send anything
        - failure
        - success

Tag summary

Content type

Image

Digest

sha256:3cb33badc

Size

6.3 MB

Last updated

over 1 year ago

docker pull sinlov/woodpecker-feishu-group-robot:1.9.0