From f3e77d138f337975c44c2b581c9743d8b0b7a5dc Mon Sep 17 00:00:00 2001 From: Ansh Goyal Date: Sat, 24 Feb 2024 22:16:55 +0530 Subject: [PATCH] modify output --- .github/workflows/notify-triagers.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/notify-triagers.yml b/.github/workflows/notify-triagers.yml index 7baa26b1ac2..2a56f5849de 100644 --- a/.github/workflows/notify-triagers.yml +++ b/.github/workflows/notify-triagers.yml @@ -31,18 +31,17 @@ jobs: if: steps.md-pr-changes.outputs.any_changed == 'true' || steps.non-md-pr-changes.outputs.any_changed == 'true' id: read-triagers-json run: | - triagers=$(cat triagers.json) - echo "::set-output name=triagers::$triagers" - echo "\"$triagers\"" | jq -r '.mdTriagers | join(" ")' >> $GITHUB_ENV - echo "\"$triagers\"" | jq -r '.codeTriagers | join(" ")' >> $GITHUB_ENV + mdTriagers=$(jq -r '.mdTriagers[]' triagers.json) + codeTriagers=$(jq -r '.codeTriagers[]' triagers.json) + echo "{md-triagers}={$mdTriagers}" >> $GITHUB_OUTPUT + echo "{code-triagers}={$codeTriagers}" >> $GITHUB_OUTPUT - 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: ${{ env.mdTriagers }}' + 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.GITHUB_TOKEN }} @@ -50,8 +49,7 @@ jobs: 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: ${{ env.codeTriagers }}' + 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.GITHUB_TOKEN }}