-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add lark notification for new Issue and PR (#6313)
* chore: add lark bot for new Issue and PR * chore: add lark bot for new Issue and PR * chore: add lark bot for new Issue and PR * chore: add lark bot for new Issue and PR * chore: add lark bot for new Issue and PR * chore: add lark bot for new Issue and PR * chore: add lark bot for new Issue and PR * chore: add lark bot for new Issue and PR
- Loading branch information
1 parent
d2235ce
commit ef4201b
Showing
3 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ team: | |
- "@zhoushaw" | ||
- "@ulivz" | ||
- "@LingyuCoder" | ||
- "@yuyutaotao" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Notify Lark on Issue and PR | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
pull_request: | ||
types: [opened] | ||
|
||
jobs: | ||
notify-lark: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- name: Check if triggered by project member | ||
id: check_member | ||
if: github.event.sender.type == 'User' | ||
env: | ||
REPO_OWNER: ${{ github.repository_owner }} | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
SENDER=${{ github.event.sender.login }} | ||
MEMBER=$(gh api /orgs/$REPO_OWNER/members/$SENDER | jq -r '.id') | ||
if [[ -n $MEMBER ]]; then | ||
echo "::set-output name=skip::true" | ||
echo "Workflow triggered by a project member: $SENDER , will NOT trigger lark notify" | ||
else | ||
echo "::set-output name=skip::false" | ||
fi | ||
- name: Notify Lark for Issue | ||
if: steps.check_member.outputs.skip != 'true' && github.event_name == 'issues' | ||
env: | ||
LARK_WEBHOOK_URL: ${{ secrets.LARK_WEBHOOK_URL }} | ||
ISSUE_TITLE: ${{ github.event.issue.title }} | ||
AUTHOR_ID: ${{ github.event.issue.user.login }} | ||
BODY: ${{ github.event.issue.body }} | ||
URL: ${{ github.server_url }}/${{ github.repository }}/issues/${{ github.event.issue.number }} | ||
run: | | ||
SHORT_BODY=$(echo "$BODY" | head -n 3) TITLE="New Issue Opened: $ISSUE_TITLE" DESCRIPTION="Issue by @$AUTHOR_ID: $SHORT_BODY. View more at $URL" TPL_COLOR="blue" TPL_BTN_TYPE="primary" ./scripts/alert/lark.js | ||
- name: Notify Lark for PR | ||
if: steps.check_member.outputs.skip != 'true' && github.event_name == 'pull_request' | ||
env: | ||
LARK_WEBHOOK_URL: ${{ secrets.LARK_WEBHOOK_URL }} | ||
PR_TITLE: ${{ github.event.pull_request.title }} | ||
AUTHOR_ID: ${{ github.event.pull_request.user.login }} | ||
BODY: ${{ github.event.pull_request.body }} | ||
URL: ${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.pull_request.number }} | ||
run: | | ||
SHORT_BODY=$(echo "$BODY" | head -n 3) TITLE="New PR Opened: $PR_TITLE" DESCRIPTION="PR by @$AUTHOR_ID: $SHORT_BODY. Check it out at $URL" TPL_COLOR="blue" TPL_BTN_TYPE="primary" ./scripts/alert/lark.js | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ef4201b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Ran ecosystem CI: Open
ef4201b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Benchmark detail: Open