From 34b1e430aa723e407ec7558078d542ccac894f3c Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Tue, 3 Oct 2023 16:43:58 +0800 Subject: [PATCH] feat(actions): add issue notification --- .github/workflows/issue-notify.yml | 17 +++++++++++++++++ .github/workflows/issue-open.yml | 19 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/issue-notify.yml diff --git a/.github/workflows/issue-notify.yml b/.github/workflows/issue-notify.yml new file mode 100644 index 0000000000..e2758db440 --- /dev/null +++ b/.github/workflows/issue-notify.yml @@ -0,0 +1,17 @@ +on: + issue_comment: + types: [created] + +jobs: + notify-author-comment: + runs-on: ubuntu-latest + if: (github.event.issue.user.id == github.event.comment.user.id) && !github.event.issue.pull_request + # find context from: https://docs.github.com/en/webhooks/webhook-events-and-payloads#issue_comment + steps: + - name: feishu notify + uses: zexi/action-issues-notify@v1 + with: + url: ${{ secrets.FEISHU_BOT_WEBHOOK_URL }} + issue_title: "${{ github.event.comment.user.login }} 回复了 issue: ${{ github.event.issue.title }}" + issue_body: "${{ tojson(github.event.comment.body) }}" + issue_link_url: "${{github.event.comment.html_url}}" diff --git a/.github/workflows/issue-open.yml b/.github/workflows/issue-open.yml index 7e47bc4429..fd2f7c7b90 100644 --- a/.github/workflows/issue-open.yml +++ b/.github/workflows/issue-open.yml @@ -2,7 +2,7 @@ name: Issue Open Check on: issues: - types: [opened] + types: [opened, reopened] jobs: issue-open-add-labels: @@ -14,3 +14,20 @@ jobs: with: actions: 'add-labels' labels: 'state/awaiting processing' + + - name: Remove require reply label + uses: actions-cool/issues-helper@v2 + with: + actions: 'remove-labels' + labels: 'state/awaiting user feedback,stale' + + notify-author-comment: + runs-on: ubuntu-latest + steps: + - name: feishu notify + uses: zexi/action-issues-notify@v1 + with: + url: ${{ secrets.FEISHU_BOT_WEBHOOK_URL }} + issue_title: "${{ github.event.issue.user.login }} 提交了 issue: ${{ github.event.issue.title }}" + issue_body: "${{ tojson(github.event.issue.body) }}" + issue_link_url: "${{github.event.issue.html_url}}"