diff --git a/.github/workflows/auto-simple-suite.yaml b/.github/workflows/auto-simple-suite.yaml index 47dc6be..c8fbaee 100644 --- a/.github/workflows/auto-simple-suite.yaml +++ b/.github/workflows/auto-simple-suite.yaml @@ -36,10 +36,30 @@ jobs: path: playwright-report/ retention-days: 7 - - name: Post to Slack - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + post-slack-notification-started: + runs-on: ubuntu-latest + steps: + - name: Get current date and time + id: date run: | - curl -X POST -H 'Content-type: application/json' \ - --data '{"text":"Simple suite results are ready"}' \ - $SLACK_WEBHOOK_URL + 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: | + blocks: + - type: "header" + text: + type: "plain_text" + text: "🚀 Simple suite pipeline started" + - type: "divider" + - type: "section" + text: + type: "mrkdwn" + text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | View workflow run>" \ No newline at end of file