From cc8e269dd0576cc4781db4d2406feeb0c268f62a Mon Sep 17 00:00:00 2001 From: Helen F Date: Thu, 30 Mar 2023 10:44:14 +0200 Subject: [PATCH] feat(ci): Use job-notification action for release notification --- .github/workflows/release.yml | 73 ++--------------------------------- 1 file changed, 3 insertions(+), 70 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 352e11fb..2554d743 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,44 +6,6 @@ env: AWS_REGION: us-east-2 DOCKER_BUILDKIT: 1 DOCKER_CACHE_PATH: ${{ github.workspace }}/tmp/docker-cache - NOTIFICATION_FIELDS: > - [ - { - title: 'Repository', - value: `${process.env.AS_REPO}`, - short: true - }, - { - title: 'Environment', - value: `${process.env.GITHUB_REF_SLUG}`, - short: true - }, - { - title: 'Author', - value: `${process.env.AS_AUTHOR}`, - short: true - }, - { - title: 'Commit', - value: `${process.env.AS_COMMIT}`, - short: true - }, - { - title: 'Job', - value: `${process.env.AS_JOB}`, - short: true - }, - { - title: 'Duration', - value: `${process.env.AS_TOOK}`, - short: true - }, - { - title: 'Commit Message', - value: `${process.env.AS_MESSAGE}`, - short: false - } - ] jobs: release: @@ -97,38 +59,9 @@ jobs: if: always() run: docker logout ${{ steps.login-ecr.outputs.registry }} - - name: Set status emoji - id: release-status - if: always() - run: | - if [ "${{ job.status }}" = "success" ]; then - echo "::set-output name=emoji::large_green_square" - echo "::set-output name=color::good" - elif [ "${{ job.status }}" = "failure" ]; then - echo "::set-output name=emoji::large_red_square" - echo "::set-output name=color::danger" - else - echo "::set-output name=emoji::large_orange_square" - echo "::set-output name=color::warning" - fi - - name: Send Slack notification if: always() - uses: 8398a7/action-slack@v3.9.0 - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + uses: scribd/job-notification@v1.0.0 with: - author_name: "GitHub on ${{ github.repository }}" - fields: repo,message,commit,author,action,eventName,ref,workflow,job,took - status: custom - job_name: 'Release' - custom_payload: | - { - text: `:${{ steps.release-status.outputs.emoji }}: *Workflow ${ process.env.AS_WORKFLOW } ${{ job.status }}*`, - attachments: [ - { - color: '${{ steps.release-status.outputs.color }}', - fields: ${{ env.NOTIFICATION_FIELDS }} - } - ] - } + token: ${{ secrets.SCRIBD_SLACK_GENERIC_TOKEN_PUBLIC }} + channel: service-foundations-release