From ebd396290303b96c5fa4432638687edcd3624112 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Tue, 29 Aug 2023 15:14:33 +0800 Subject: [PATCH] conf: action notify [test] --- .github/workflows/Deploy CN.yml | 2 +- .github/workflows/Deploy.yml | 47 +++++++++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Deploy CN.yml b/.github/workflows/Deploy CN.yml index 5fd67cfb..17b30125 100644 --- a/.github/workflows/Deploy CN.yml +++ b/.github/workflows/Deploy CN.yml @@ -1,4 +1,4 @@ -# . +# Disabled name: 🚀 Deploy INFO-SYS on: # Triggers the workflow on push or pull request events but only for the master branch diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml index eec9b0a3..065c3f0b 100644 --- a/.github/workflows/Deploy.yml +++ b/.github/workflows/Deploy.yml @@ -22,7 +22,7 @@ jobs: port: ${{ secrets.US_FTP_PORT }} local-dir: ./ server-dir: /information-system/ - # dry-run: true + dry-run: true exclude: | **/.git* **/.git*/** @@ -77,7 +77,7 @@ jobs: port: ${{ secrets.CN_FTP_PORT }} local-dir: ./ server-dir: /wwwroot/origin-cht.mycht.cn/ - # dry-run: true + dry-run: true # log-level: verbose exclude: | **/.git* @@ -92,3 +92,46 @@ jobs: *.exe *.docx .ftp-deploy-sync-state.json + + hn-notification: + needs: gh-win-cn-deploy + name: 🔔 Send notificaiton + runs-on: ubuntu-latest + if: always() # set "always" + steps: + # run this action to get the workflow conclusion + # You can get the conclusion via env (env.WORKFLOW_CONCLUSION) + - uses: technote-space/workflow-conclusion-action@v3 + + - name: Expose git commit data + uses: rlespinasse/git-commit-data-action@v1 + + - name: Print git commit data + run: | + echo "Get workflow conclusion" + echo " - ${{ env.WORKFLOW_CONCLUSION }}" + echo "Get commit info" + echo " - ${{ env.GIT_COMMIT_SHA }}" + echo " - ${{ env.GIT_COMMIT_SHORT_SHA }}" + echo "Get author info" + echo " - ${{ env.GIT_COMMIT_AUTHOR }}" + echo " - ${{ env.GIT_COMMIT_AUTHOR_NAME }}" + echo " - ${{ env.GIT_COMMIT_AUTHOR_EMAIL }}" + echo "Get committer info" + echo " - ${{ env.GIT_COMMIT_COMMITTER }}" + echo " - ${{ env.GIT_COMMIT_COMMITTER_NAME }}" + echo " - ${{ env.GIT_COMMIT_COMMITTER_EMAIL }}" + echo "Get message info" + echo " - ${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}" + echo " - ${{ env.GIT_COMMIT_MESSAGE_SUBJECT_SANITIZED }}" + echo " - ${{ env.GIT_COMMIT_MESSAGE_BODY }}" + + # # run other action with the workflow conclusion + # - uses: 8398a7/action-slack@v3 + # with: + # # status: ${{ env.WORKFLOW_CONCLUSION }} # neutral, success, skipped, cancelled, timed_out, action_required, failure + # status: failure + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + # if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure