From 0f243c1497f3a6b5d35cffbd0984de8762eb7e62 Mon Sep 17 00:00:00 2001 From: lwz9103 Date: Tue, 20 Aug 2024 11:17:20 +0800 Subject: [PATCH] [GLUTEN-6915][CH] Follow VL, fix github issue comment --- .github/workflows/clickhouse_be_trigger.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/clickhouse_be_trigger.yml b/.github/workflows/clickhouse_be_trigger.yml index f19a328adcb3..19f9b55a0303 100644 --- a/.github/workflows/clickhouse_be_trigger.yml +++ b/.github/workflows/clickhouse_be_trigger.yml @@ -34,17 +34,21 @@ on: jobs: add-comment: runs-on: ubuntu-latest + permissions: write-all steps: - name: Checkout code uses: actions/checkout@v4 - name: Sleep for Dev PR workflow done run: | sleep 15 - - name: Add comment to PR - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - COMMENT="Run Gluten Clickhouse CI" - URL=$(jq -r .pull_request.comments_url "$GITHUB_EVENT_PATH") - curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST -d "{\"body\":\"$COMMENT\"}" "${URL}" + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.number, + body: "Run Gluten Clickhouse CI" + });