diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index fc7d8f3b12..d842badeb9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -98,92 +98,12 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Slack notification when failure on main (includes ) - - name: Notify Slack (main) - if: failure() && github.ref == 'refs/heads/main' - id: slack-main - uses: slackapi/slack-github-action@v1.27.1 - with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} - payload: | - { - "attachments": [ - { - "color": "#ff0000", - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": ":boom: GitHub Action failed on the main branch!", - "emoji": true - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Hey , we have a failure on *main*!" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Pull request title:* `${{ github.event.pull_request.title }}`" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*E2E tests result:* `${{ job.status }}`" - } - }, - { - "type": "actions", - "elements": [ - { - "type": "button", - "text": { - "type": "plain_text", - "text": ":github: Open Pull request" - }, - "url": "${{ github.event.pull_request.html_url }}" - }, - { - "type": "button", - "text": { - "type": "plain_text", - "text": ":github: Open failed GitHub Action" - }, - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - }, - { - "type": "button", - "text": { - "type": "plain_text", - "text": ":github: Download Report" - }, - "url": "${{ steps.artifact-upload-step.outputs.artifact-url }}" - } - ] - } - ] - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFICATIONS_TOKEN }} # Webhook from Slack Application - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - - # Slack notification when failure on other branches (no ) - - name: Notify Slack (non-main) - if: failure() && github.ref != 'refs/heads/main' - id: slack-non-main + - name: Notify Slack when failure + id: Slack uses: slackapi/slack-github-action@v1.27.1 + if: failure() with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} + channel-id: ${{ secrets.SLACK_CHANNEL_ID }} # Slack channel-id of #spirit-design-system-notifications_en payload: | { "attachments": [ @@ -202,7 +122,9 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "*Pull request title:* `${{ github.event.pull_request.title }}`" + "text": "${{ github.ref == 'refs/heads/main' && 'Hey :' || 'Hey everyone:' }} " + + " E2E tests just failed on `${{ github.ref }}`!\n\n" + + "*Pull request title:* `${{ github.event.pull_request.title }}`" } }, {