From e3def5cf07efbbf4fb967ea8c9a92c188f14aeec Mon Sep 17 00:00:00 2001 From: pingke Date: Mon, 14 Oct 2024 17:21:35 +0800 Subject: [PATCH] test send email for action result --- .github/workflows/test.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..b7971049 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +name: CI Workflow + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Run tests + run: npm test + + - name: Notify on Slack + if: always() # 无论成功或失败,始终发送通知 + uses: slackapi/slack-github-action@v1.23.0 + with: + slack-message: | + 工作流 ${{ github.workflow }} 已完成。 + 状态: ${{ job.status }} + 触发者: ${{ github.actor }} + 仓库: ${{ github.repository }} + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file