Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add workflow for feishu/lark notification #100

Merged
merged 4 commits into from
Oct 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/feishu-notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Feishu Notification

on:
pull_request:
types: [opened]
SilverRainZ marked this conversation as resolved.
Show resolved Hide resolved
issues:
types: [opened]

jobs:
pr-opened:
name: Pull Request Opened Notification
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
runs-on: ubuntu-latest
steps:
- name: Send Feishu Message
env:
ACTIONS_FEISHU_TAG: v1.3.1
INPUT_WEBHOOK: ${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}
INPUT_MESSAGE_TYPE: post
INPUT_TITLE: New Pull Request
INPUT_CONTENT: |
@${{ github.event.pull_request.user.login }} opened pull request #${{ github.event.pull_request.number }}:

${{ github.event.pull_request.title }}

See: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}

run: |
wget -q https://github.com/xiachufang/actions-feishu/releases/download/${{ env.ACTIONS_FEISHU_TAG }}/linux-amd64-actions-feishu.tar.gz
tar zxf linux-amd64-actions-feishu.tar.gz feishu
SilverRainZ marked this conversation as resolved.
Show resolved Hide resolved
./feishu

issues-opened:
name: Issue Opened Notification
if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }}
runs-on: ubuntu-latest
steps:
- name: Send Feishu Message
env:
ACTIONS_FEISHU_TAG: v1.3.1
INPUT_WEBHOOK: ${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}
INPUT_MESSAGE_TYPE: post
INPUT_TITLE: New Issue
INPUT_CONTENT: |
@${{ github.event.issue.user.login }} opened issues #${{ github.event.issue.number }}:

${{ github.event.issue.title }}

See: https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}

run: |
wget -q https://github.com/xiachufang/actions-feishu/releases/download/${{ env.ACTIONS_FEISHU_TAG }}/linux-amd64-actions-feishu.tar.gz
tar zxf linux-amd64-actions-feishu.tar.gz feishu
./feishu