From d99abf8af8112442787f7e8ebd019a32f2f48025 Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 28 Feb 2024 14:56:16 +0530 Subject: [PATCH] try github script to comment --- .github/workflows/notify-triager.yml | 44 ++++++++++++++++++---------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/.github/workflows/notify-triager.yml b/.github/workflows/notify-triager.yml index 374ff5b682b2..c93336a2be71 100644 --- a/.github/workflows/notify-triager.yml +++ b/.github/workflows/notify-triager.yml @@ -36,20 +36,34 @@ jobs: echo "md-triagers=$mdTriagers" >> $GITHUB_OUTPUT echo "code-triagers=$codeTriagers" >> $GITHUB_OUTPUT - - name: Create Comment for .md files + # - name: Create Comment for .md files + # if: steps.md-pr-changes.outputs.any_changed == 'true' + # uses: mshick/add-pr-comment@v2.8.2 + # with: + # message: "The PR contains modifications to `.md` files, hence tagging Docs triagers for review and approval. + # cc: ${{ steps.read-triagers-json.outputs.md-triagers }}" + # env: + # GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + + # - name: Create Comment for non-.md files + # if: steps.non-md-pr-changes.outputs.any_changed == 'true' + # uses: mshick/add-pr-comment@v2.8.2 + # with: + # message: "The PR contains modifications to code related files, hence tagging Code triagers for review and approval. + # cc: ${{ steps.read-triagers-json.outputs.code-triagers }}" + # env: + # GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + + - name: Create comment for .md files if: steps.md-pr-changes.outputs.any_changed == 'true' - uses: mshick/add-pr-comment@v2.8.2 - with: - message: "The PR contains modifications to `.md` files, hence tagging Docs triagers for review and approval. - cc: ${{ steps.read-triagers-json.outputs.md-triagers }}" - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - - - name: Create Comment for non-.md files - if: steps.non-md-pr-changes.outputs.any_changed == 'true' - uses: mshick/add-pr-comment@v2.8.2 + uses: actions/github-script@v6 with: - message: "The PR contains modifications to code related files, hence tagging Code triagers for review and approval. - cc: ${{ steps.read-triagers-json.outputs.code-triagers }}" - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + github-token: ${{ secrets.GH_TOKEN }} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `The PR contains modifications to `.md` files, hence tagging Docs triagers for review and approval. + # cc: ${{ steps.read-triagers-json.outputs.md-triagers }}` + }) \ No newline at end of file