From 78a7e94dda569fa951f1a91afafadfa46013320e Mon Sep 17 00:00:00 2001 From: andyziye <108652123+andyziye@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:21:45 +0800 Subject: [PATCH 1/3] Create test_a.yml --- .github/workflows/test_a.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/test_a.yml diff --git a/.github/workflows/test_a.yml b/.github/workflows/test_a.yml new file mode 100644 index 0000000000000..4d96d7050891a --- /dev/null +++ b/.github/workflows/test_a.yml @@ -0,0 +1,35 @@ +name: Add Comment + +on: + pull_request: + types: + - opened + +jobs: + add_comment: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Add a Comment + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { owner, repo } = context.repo; + const issueNumber = context.issue.number; + + const comment = `Hello! Thank you for opening this pull request. We'll review it soon.`; + + const { data: commentData } = await github.issues.createComment({ + owner, + repo, + issue_number: issueNumber, + body: comment, + }); From 5fcc7cd884083461a9be0609a785bc3c9247fd23 Mon Sep 17 00:00:00 2001 From: andyziye <108652123+andyziye@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:27:40 +0800 Subject: [PATCH 2/3] Update test_a.yml --- .github/workflows/test_a.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_a.yml b/.github/workflows/test_a.yml index 4d96d7050891a..009cda40acfcf 100644 --- a/.github/workflows/test_a.yml +++ b/.github/workflows/test_a.yml @@ -20,7 +20,7 @@ jobs: - name: Add a Comment uses: actions/github-script@v4 with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.PAT }} script: | const { owner, repo } = context.repo; const issueNumber = context.issue.number; From 7d531e7b66c19c10cccc34e7095aaac9acecdd39 Mon Sep 17 00:00:00 2001 From: andyziye <108652123+andyziye@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:28:45 +0800 Subject: [PATCH 3/3] Update test_a.yml --- .github/workflows/test_a.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_a.yml b/.github/workflows/test_a.yml index 009cda40acfcf..55f79e1b81196 100644 --- a/.github/workflows/test_a.yml +++ b/.github/workflows/test_a.yml @@ -4,6 +4,7 @@ on: pull_request: types: - opened + - synchronize jobs: add_comment: