From 7a8efb1934ce7526066462bbe09392b4388a3fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Thu, 16 Jan 2025 09:56:26 +0100 Subject: [PATCH] chore(ci): display head ref in slack notification message Default 'Ref' displayed in message relies on github.ref value. On pull_request_target, it's the base_ref, instead of head_ref, that is set as value for github.ref. We cannot change 'Ref' field directly. As a workaround, we hide 'Ref' in the message and display the head_ref directly in SLACK_MESSAGE. --- .github/workflows/aws_tfhe_fast_tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aws_tfhe_fast_tests.yml b/.github/workflows/aws_tfhe_fast_tests.yml index a3925f0332..86174f8481 100644 --- a/.github/workflows/aws_tfhe_fast_tests.yml +++ b/.github/workflows/aws_tfhe_fast_tests.yml @@ -11,6 +11,8 @@ env: SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png SLACK_USERNAME: ${{ secrets.BOT_USERNAME }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: event,action url,commit + BRANCH: ${{ github.head_ref || github.ref }} IS_PULL_REQUEST: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} REF: ${{ github.event.pull_request.head.sha || github.sha }} @@ -287,7 +289,7 @@ jobs: uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 env: SLACK_COLOR: ${{ job.status }} - SLACK_MESSAGE: "Fast AWS tests finished with status: ${{ job.status }}. (${{ env.ACTION_RUN_URL }})" + SLACK_MESSAGE: "Fast AWS tests finished with status: ${{ job.status }} on '${{ env.BRANCH }}'. (${{ env.ACTION_RUN_URL }})" teardown-instance: name: Teardown instance (fast-tests) @@ -311,4 +313,4 @@ jobs: uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 env: SLACK_COLOR: ${{ job.status }} - SLACK_MESSAGE: "Instance teardown (fast-tests) finished with status: ${{ job.status }}. (${{ env.ACTION_RUN_URL }})" + SLACK_MESSAGE: "Instance teardown (fast-tests) finished with status: ${{ job.status }} on '${{ env.BRANCH }}'. (${{ env.ACTION_RUN_URL }})"