From bf9f6097c9d1d2ad564bbd1d03f3cdca40e1f686 Mon Sep 17 00:00:00 2001 From: Vitus <144411726+Vitus213@users.noreply.github.com> Date: Tue, 8 Apr 2025 17:33:29 +0800 Subject: [PATCH] feat(nofity): add feishu notify (#46) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 自己造的轮子 * feat(notify): sync notify to feishu using existing GitHub Action (#47) * feat(notify): sync notify to feishu * fix(notify): wrong usage of env secret * feat(workflow): expand branch support in feishu_bot.yml for pull requests and pushes * feat(ci): only run under source code changes * feat(ci): add notification under workflows * fix(notify): change action name to trigger workflow * feat(notify): change secrets using repo secrets * remove temporary push trigger --------- Co-authored-by: Samuel Dai --- .github/workflows/feishu-bot.yml | 40 ++++++++++++++++++++++++ .github/workflows/nix-github-actions.yml | 10 ++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/feishu-bot.yml diff --git a/.github/workflows/feishu-bot.yml b/.github/workflows/feishu-bot.yml new file mode 100644 index 0000000..78dec5f --- /dev/null +++ b/.github/workflows/feishu-bot.yml @@ -0,0 +1,40 @@ +name: Feishu synchronize + +on: + workflow_run: + workflows: [ nix-github-actions.yml ] + types: + - completed + discussion: + types: [created, edited, answered] + discussion_comment: + types: [created] + issues: + types: [opened, edited, milestoned, pinned, reopened, closed, assigned, unassigned] + issue_comment: + types: [created, edited] + milestone: + types: [opened, deleted] + project_card: + types: [created] + pull_request: + branches: ['master', 'main', 'feature/*', 'bugfix/*', 'feat-*', 'fix-*'] + types: [opened, reopened, review_requested, review_request_removed, ready_for_review, edited, assigned, unassigned] + pull_request_review: + types: [submitted, edited, dismissed] + pull_request_review_comment: + types: [created, edited, deleted] + pull_request_target: + types: [assigned, opened, synchronize, reopened] + push: + branches: ['master', 'main'] + +jobs: + send-event: + name: Webhook + runs-on: ubuntu-latest + steps: + - uses: Samuka007/feishu-bot-webhook-action@main + with: + webhook: ${{ secrets.FEISHU_BOT_WEBHOOK }} + signkey: ${{ secrets.FEISHU_BOT_SIGNKEY }} diff --git a/.github/workflows/nix-github-actions.yml b/.github/workflows/nix-github-actions.yml index bf3de13..b767765 100644 --- a/.github/workflows/nix-github-actions.yml +++ b/.github/workflows/nix-github-actions.yml @@ -2,7 +2,17 @@ name: Nix Flake actions on: pull_request: + paths: + - 'crates/**' + - 'Cargo.lock' + - 'flake.lock' + - '.github/workflows/nix-github-actions.yml' push: + paths: + - 'crates/**' + - 'Cargo.lock' + - 'flake.lock' + - '.github/workflows/nix-github-actions.yml' jobs: nix-matrix: