From 12a315845841b3c1290498fd0a0e3c82c4d18276 Mon Sep 17 00:00:00 2001 From: William Black Date: Sat, 1 Jul 2023 00:44:58 -0700 Subject: [PATCH] Naively add tardis bot comments to `build-docs.yml` --- .github/workflows/build-docs.yml | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 7a560c37..1522b796 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -91,3 +91,49 @@ jobs: force_orphan: ${{ env.CLEAN_BRANCH }} user_name: 'TARDIS Bot' user_email: 'tardis.sn.bot@gmail.com' + + - name: Find comment + uses: peter-evans/find-comment@v1 + id: fc + with: + issue-number: ${{ github.event.number }} + body-includes: Hi, human. + if: always() && github.event_name == 'pull_request_target' + + - name: Post comment (success) + uses: peter-evans/create-or-update-comment@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.number }} + comment-id: ${{ steps.fc.outputs.comment-id }} + edit-mode: replace + body: | + *\*beep\* \*bop\** + + Hi, human. + + The **`${{ github.workflow }}`** workflow has **succeeded** :heavy_check_mark: + + [**Click here**](${{ env.URL }}) to see your results. + env: + URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pull/${{ github.event.number }}/index.html + if: success() && github.event_name == 'pull_request_target' + + - name: Post comment (failure) + uses: peter-evans/create-or-update-comment@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.number }} + comment-id: ${{ steps.fc.outputs.comment-id }} + edit-mode: replace + body: | + *\*beep\* \*bop\** + + Hi, human. + + The **`${{ github.workflow }}`** workflow has **failed** :x: + + [**Click here**](${{ env.URL }}) to see the build log. + env: + URL: https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}?check_suite_focus=true + if: failure() && github.event_name == 'pull_request_target'