Notify team chat of GitHub Actions runs.

PiperOrigin-RevId: 569231063
Change-Id: I9e66b90ff944e9a6a0898e336c7f049a07c3609d
This commit is contained in:
Saran Tunyasuvunakool
2023-09-28 10:56:33 -07:00
committed by Copybara-Service
parent 8e00f8029e
commit 7e5711ad36
+10
View File
@@ -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 }}>."}'