auto check pr gh action: Add output of status checks as a comment in the thread

This commit is contained in:
Ishan Jain 2021-09-02 22:56:29 +05:30
parent 7d45c6ad8f
commit 0da788cdb2

View File

@ -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 }}"