Skip to main content
Plugins / Woodpecker Feishu Bot

Woodpecker Feishu Bot

by Wener

Send notify to feishu/飞书 in text or markdown format


Example

variables:
  - &notify_image 'wener/woodpecker-feishu-bot'

pipeline:
  Notify Start:
    image: *notify_image
    settings:
      feishu_bot_url:
        from_secret: feishu_bot_url
      feishu_bot_secret:
        from_secret: feishu_bot_secret
      markdown: |
        πŸ—οΈ Start building <%= env.CI_REPO_NAME %> #<%= env.CI_BUILD_NUMBER %>

        - <%= $.link(env.CI_COMMIT,env.CI_COMMIT_LINK) %> <%=env.CI_COMMIT_MESSAGE.replaceAll(/\n/g,';')%>

        πŸ“¦οΈ <%=$.link(env.CI_REPO_NAME,env.CI_BUILD_LINK)%>

  # Do the real work

  Notify Done:
    image: *notify_image
    settings:
      feishu_bot_url:
        from_secret: feishu_bot_url
      feishu_bot_secret:
        from_secret: feishu_bot_secret
      markdown: |
        <%= env.CI_PIPELINE_STATUS === 'success' ? 'βœ…' : '❌' %> Building complete <%= env.CI_REPO_NAME %> #<%= env.CI_BUILD_NUMBER %>

        - <%= env.CI_COMMIT_MESSAGE %>

        πŸ“¦οΈ <%= $.link(env.CI_REPO_NAME, env.CI_BUILD_LINK) %> Β· ⏳<%= env.CI_PIPELINE_FINISHED - env.CI_PIPELINE_STARTED %>
    when:
      status: [ success, failure ]

settings

setting for
feisbu_bot_url
feisbu_bot_secret
content
format format of content, default to markdown
markdown =content+format=markdown
text =content+format=text
dry_run
debug print env
template render as eta template, default to true
failsafe if true, ignore error
  • eta template context
    • env -> process.env
    • fs -> fs-extra