From 203a7a3967bff466369f5f9f8147526b5905b324 Mon Sep 17 00:00:00 2001 From: Daria Domina Date: Wed, 1 Oct 2025 17:04:33 +0200 Subject: [PATCH 1/3] use the action for rich message --- .github/workflows/auto-simple-suite.yaml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto-simple-suite.yaml b/.github/workflows/auto-simple-suite.yaml index 47dc6be..3579c1c 100644 --- a/.github/workflows/auto-simple-suite.yaml +++ b/.github/workflows/auto-simple-suite.yaml @@ -36,10 +36,18 @@ jobs: path: playwright-report/ retention-days: 7 - - name: Post to Slack - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - run: | - curl -X POST -H 'Content-type: application/json' \ - --data '{"text":"Simple suite results are ready"}' \ - $SLACK_WEBHOOK_URL + post-slack-notification-started: + runs-on: ubuntu-latest + steps: + - name: Post a message in a channel + uses: slackapi/slack-github-action@v2.1.1 + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + text: "Simple suite pipeline started" + blocks: + - type: "section" + text: + type: "mrkdwn" + text: "Trigger: ${{ github.event_name }}" \ No newline at end of file From 6227381cfe5e2e096e4779e1dab2ffce745714ba Mon Sep 17 00:00:00 2001 From: Daria Domina Date: Wed, 1 Oct 2025 17:18:38 +0200 Subject: [PATCH 2/3] improve the rich message --- .github/workflows/auto-simple-suite.yaml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-simple-suite.yaml b/.github/workflows/auto-simple-suite.yaml index 3579c1c..34fb90d 100644 --- a/.github/workflows/auto-simple-suite.yaml +++ b/.github/workflows/auto-simple-suite.yaml @@ -39,15 +39,31 @@ jobs: post-slack-notification-started: runs-on: ubuntu-latest steps: + - name: Get current date and time + id: date + run: | + RUN_DATE=$(date -u +%Y-%m-%d) + RUN_TIME=$(date -u +%H:%M:%S) + echo "date=$RUN_DATE" >> $GITHUB_OUTPUT + echo "time=$RUN_TIME" >> $GITHUB_OUTPUT + - name: Post a message in a channel uses: slackapi/slack-github-action@v2.1.1 with: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | - text: "Simple suite pipeline started" blocks: + - type: "header" + text: + type: "plain_text" + text: "🚀 Simple suite pipeline started" + - type: "context" + elements: + - type: "mrkdwn" + text: "📅 ${{ steps.date.outputs.date }} 🕒 ${{ steps.date.outputs.time }} UTC" + - type: "divider" - type: "section" text: type: "mrkdwn" - text: "Trigger: ${{ github.event_name }}" \ No newline at end of file + text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | View workflow run>" \ No newline at end of file From 7882fe83d2b55df9234728d16cff49212c7ebece Mon Sep 17 00:00:00 2001 From: Daria Domina Date: Wed, 1 Oct 2025 17:45:31 +0200 Subject: [PATCH 3/3] remove the date and time from the message --- .github/workflows/auto-simple-suite.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/auto-simple-suite.yaml b/.github/workflows/auto-simple-suite.yaml index 34fb90d..c8fbaee 100644 --- a/.github/workflows/auto-simple-suite.yaml +++ b/.github/workflows/auto-simple-suite.yaml @@ -58,10 +58,6 @@ jobs: text: type: "plain_text" text: "🚀 Simple suite pipeline started" - - type: "context" - elements: - - type: "mrkdwn" - text: "📅 ${{ steps.date.outputs.date }} 🕒 ${{ steps.date.outputs.time }} UTC" - type: "divider" - type: "section" text: