From f8233dc8596be72cb55e7f202c1c10f4014428d3 Mon Sep 17 00:00:00 2001 From: Ourai L Date: Thu, 4 Jul 2024 08:36:54 +0800 Subject: [PATCH] count task completion when PR merged --- .github/workflows/count-task-completion.yml | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/count-task-completion.yml diff --git a/.github/workflows/count-task-completion.yml b/.github/workflows/count-task-completion.yml new file mode 100644 index 000000000..b468b8c3a --- /dev/null +++ b/.github/workflows/count-task-completion.yml @@ -0,0 +1,34 @@ +name: Count task completion when PR merged + +on: + pull_request: + types: [closed] + branches: + - main + paths: + - members/*/** + workflow_dispatch: + +jobs: + count: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v3 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 14.15.3 + - name: Count task completion + run: node scripts/count.js + - name: Commit changes + run: | + cd site-dist + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add . + git commit -m "chore: update counted task completion" + - uses: ad-m/github-push-action@master + with: + branch: ${{ github.ref }}