Fix broken Bash substitution on macOS and only nofify failures.

PiperOrigin-RevId: 569428932
Change-Id: Id23501c3e8dd8b615dc6f2677fb7e21a1b0b0b34
This commit is contained in:
Saran Tunyasuvunakool
2023-09-29 02:08:01 -07:00
committed by Copybara-Service
parent d70266fd55
commit c2f73ee755
+3 -4
View File
@@ -229,20 +229,19 @@ jobs:
source ${{ matrix.tmpdir }}/venv/bin/activate && source ${{ matrix.tmpdir }}/venv/bin/activate &&
pytest -v --pyargs mujoco pytest -v --pyargs mujoco
- name: Notify team chat - name: Notify team chat
if: ${{ always() && github.event_name == 'push' }}
shell: bash shell: bash
env: env:
GCHAT_API: ${{ secrets.GCHAT_API }} GCHAT_API: ${{ secrets.GCHAT_API }}
RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/\ JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/\
${{ github.run_id }}" ${{ github.run_id }}"
JOB_STATUS: ${{ job.status }} if: ${{ failure() && github.event_name == 'push' && env.GCHAT_API != '' }}
run: > run: >
curl curl
"$GCHAT_API&threadKey=$GITHUB_SHA&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD" "$GCHAT_API&threadKey=$GITHUB_SHA&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD"
-X POST -X POST
-H "Content-Type: application/json" -H "Content-Type: application/json"
-d "{ -d "{
'text': '<$RUN_URL|*${JOB_STATUS^^}*>: 'text': '<$JOB_URL|*FAILURE*>:
job \`${{ matrix.os }}${{ matrix.additional_label }}\` job \`${{ matrix.os }}${{ matrix.additional_label }}\`
commit \`$(echo $GITHUB_SHA | head -c6)\`\n commit \`$(echo $GITHUB_SHA | head -c6)\`\n
\`\`\`Author: ${{ github.event.head_commit.author.name }} \`\`\`Author: ${{ github.event.head_commit.author.name }}