From 0418c918ccdb20518de9cd26c88c9c41ffe35fe1 Mon Sep 17 00:00:00 2001 From: ivanmjartan Date: Mon, 16 Dec 2024 13:37:34 +0100 Subject: [PATCH] chore: add post merge notification risk: nonprod --- .../workflows/push-e2e-integrated-tests.yaml | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-e2e-integrated-tests.yaml b/.github/workflows/push-e2e-integrated-tests.yaml index 55ac0fedfaf..65da7729519 100644 --- a/.github/workflows/push-e2e-integrated-tests.yaml +++ b/.github/workflows/push-e2e-integrated-tests.yaml @@ -6,11 +6,45 @@ on: - release jobs: + pull-request-info: + runs-on: + group: infra1-runners-arc + labels: runners-small + outputs: + author: ${{ steps.author.outputs.result }} + steps: + - uses: actions/github-script@v7 + id: author + with: + script: | + const pullRequests = await github.rest.repos.listPullRequestsAssociatedWithCommit({ + commit_sha: context.sha, + owner: context.repo.owner, + repo: context.repo.repo, + }); + + return pullRequests?.data[0]?.user?.login; + result-encoding: string + e2e-integrated: - if: ${{ !(startsWith(github.event.head_commit.message, 'Release ') || startsWith(github.event.head_commit.message, format('chore{0} bump versions to', ':'))) }} + if: ${{ !(startsWith(github.event.head_commit.message, format('chore{0} bump versions to', ':')) || startsWith(github.event.head_commit.message, format('chore{0} update Hugo version to', ':'))) }} permissions: id-token: write contents: read pull-requests: read uses: ./.github/workflows/rw-rush-build-e2e-tests-integrated.yml secrets: inherit + + notify-failed-to-slack: + if: ${{ !cancelled() && needs.e2e-integrated.result == 'failure' }} + needs: [e2e-integrated,pull-request-info] + runs-on: [ubuntu-latest] + steps: + - name: Inform to slack when workflows failed + uses: slackapi/slack-github-action@v1.25.0 + with: + channel-id: "#javascript-notifications" + slack-message: ":warning: post merge e2e in *gooddata-sdk-ui* initiated by ${{env.AUTHOR}} encountered an error during execution. Check the *<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|log here>* for further information." + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + AUTHOR: ${{ needs.pull-request-info.outputs.author }}