From ed605c8e4b2d99a318f0d13da59470c79dbdda01 Mon Sep 17 00:00:00 2001 From: Arthur Pan <81165851+KingArthur0205@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:12:31 +0800 Subject: [PATCH] Create Under Review.yml --- .github/workflows/Under Review.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/Under Review.yml diff --git a/.github/workflows/Under Review.yml b/.github/workflows/Under Review.yml new file mode 100644 index 0000000..b62dd25 --- /dev/null +++ b/.github/workflows/Under Review.yml @@ -0,0 +1,28 @@ +name: Update Project Status on CSV Comment + +on: + issue_comment: + types: [created] + +jobs: + update-project-status: + runs-on: ubuntu-latest + + steps: + - name: Check if Comment Contains CSV Attachment + id: check_csv + uses: actions/github-script@v6 + with: + script: | + const commentBody = context.payload.comment.body; + const csvPattern = /\.(csv|zip)\b/; + return csvPattern.test(commentBody); + + - name: Update Project Item Status to "Under Review" + if: steps.check_csv.outputs.result == 'true' + uses: nipe0324/update-project-v2-item-field@v2.0.1 + with: + project-url: https://github.com/users/ben-domingue/projects/1 + github-token: ${{ secrets.PROJECTS_TEST }} + field-name: Status + field-value: Under Review