From 0da788cdb2f3d8ab8c4af2ab66fbe58b3a542673 Mon Sep 17 00:00:00 2001 From: Ishan Jain Date: Thu, 2 Sep 2021 22:56:29 +0530 Subject: [PATCH] auto check pr gh action: Add output of status checks as a comment in the thread --- .github/workflows/status.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/status.yml b/.github/workflows/status.yml index 0470aa1e..fc6ede0a 100644 --- a/.github/workflows/status.yml +++ b/.github/workflows/status.yml @@ -27,6 +27,22 @@ jobs: run: | npm install - name: Run status checks - run: node ./status-checks + id: status_check + run: | + output=$(node ./status-checks) + # Escape newlines so _all_ the output is included in the set-output + output="${output//'%'/'%25'}" + output="${output//$'\n'/'%0A'}" + output="${output//$'\r'/'%0D'}" + echo "::set-output name=status_check_output::$output" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Auto Comment Status Check Result + # Use with caution + uses: bubkoo/auto-comment@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pullRequestSynchronize: "${{ steps.status_check.outputs.output }}" + pullRequestAssigned: "${{ steps.status_check.outputs.output }}" + pullRequestOpened: "${{ steps.status_check.outputs.output }}" + pullRequestReopened: "${{ steps.status_check.outputs.output }}"