From 7e5711ad36c30a06750354461510cd2604d5f7fb Mon Sep 17 00:00:00 2001 From: Saran Tunyasuvunakool Date: Thu, 28 Sep 2023 10:56:33 -0700 Subject: [PATCH] Notify team chat of GitHub Actions runs. PiperOrigin-RevId: 569231063 Change-Id: I9e66b90ff944e9a6a0898e336c7f049a07c3609d --- .github/workflows/build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d978acbe..098a766d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -228,3 +228,13 @@ jobs: run: > source ${{ matrix.tmpdir }}/venv/bin/activate && pytest -v --pyargs mujoco + - name: Notify team chat + if: ${{ always() && github.event_name == "push" }} + env: + GCHAT_API: "${{ secrets.GCHAT_API }}" + RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + RUN_RESULT: ${{ success() && 'SUCCEEDED' || 'FAILED' }} + run: > + curl -X POST "$GCHAT_API" + -H "Content-Type: application/json" + -d '{"text": "GitHub Actions run *$RUN_RESULT* for commit <$RUN_URL|$(echo $GITHUB_SHA | head -c6)\n\n${{ github.event.head_commit.message }}>."}'