diff --git a/.github/workflows/cd-pipeline.yml b/.github/workflows/cd-pipeline.yml index 484e259bdb..a7642db749 100644 --- a/.github/workflows/cd-pipeline.yml +++ b/.github/workflows/cd-pipeline.yml @@ -169,3 +169,15 @@ jobs: echo "Could not update the index after $max_attempts attempts" exit 1 fi + notify: + name: Send notification + needs: + - vib-publish + - update-deprecated-index + if: ${{ always() && (needs.vib-publish.result == 'failure' || needs.update-deprecated-index.result == 'failure') }} + uses: bitnami/support/.github/workflows/gchat-notification.yml@main + with: + workflow: ${{ github.workflow }} + job-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + secrets: + webhook-url: ${{ secrets.GCHAT_CONTENT_ALERTS_WEBHOOK_URL }} diff --git a/.github/workflows/gchat-notification.yml b/.github/workflows/gchat-notification.yml deleted file mode 100644 index 3f06251b74..0000000000 --- a/.github/workflows/gchat-notification.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright Broadcom, Inc. All Rights Reserved. -# SPDX-License-Identifier: APACHE-2.0 - -name: 'GChat Notification' -on: - workflow_call: - inputs: - workflow: - type: string - required: true - job-url: - type: string - required: true - repository: - type: string - secrets: - GCHAT_WEBHOOK_URL: - required: true -# Remove all permissions by default -permissions: {} -jobs: - notification: - name: Google Chat Notification - runs-on: ubuntu-latest - steps: - - name: Notify - env: - JOB_URL: ${{ inputs.job-url }} - GH_WORKFLOW: ${{ inputs.workflow }} - GH_REPOSITORY: ${{ inputs.repository != '' && inputs.repository || github.repository }} - GCHAT_WEBHOOK_URL: ${{ secrets.GCHAT_WEBHOOK_URL }} - run: | - tmp_file=$(mktemp) - cat >"${tmp_file}"<. - EOF - - # Use curl to send the JSON to Google. - escapedText=$(sed -e 's/\n/\\n/g' -e 's/"/\\"/g' -e "s/'/\\'/g" "${tmp_file}") - json="{\"text\": \"$escapedText\"}" - curl -o /tmp/out -s --fail -X POST -H 'Content-Type: application/json' -d "$json" "${GCHAT_WEBHOOK_URL}" diff --git a/.github/workflows/index-monitor.yml b/.github/workflows/index-monitor.yml index 53dffa1653..818aaadc7c 100644 --- a/.github/workflows/index-monitor.yml +++ b/.github/workflows/index-monitor.yml @@ -113,8 +113,9 @@ jobs: name: Send notification needs: [validation-check, integrity-check] if: ${{ always() && (needs.validation-check.outputs.result != 'ok' || needs.integrity-check.outputs.result != 'ok') }} - uses: bitnami/charts/.github/workflows/gchat-notification.yml@main + uses: bitnami/support/.github/workflows/gchat-notification.yml@main with: workflow: ${{ github.workflow }} job-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - secrets: inherit + secrets: + webhook-url: ${{ secrets.GCHAT_WEBHOOK_URL }} diff --git a/.github/workflows/index-update.yml b/.github/workflows/index-update.yml index eb80e0211e..ed582843e3 100644 --- a/.github/workflows/index-update.yml +++ b/.github/workflows/index-update.yml @@ -115,3 +115,14 @@ jobs: # Push changes git add bitnami/index.yaml && git commit --signoff --amend --no-edit git push origin index --force-with-lease=index:${current_commit_id} + notify: + name: Send notification + needs: + - update-index + if: ${{ always() && (needs.update-index.result == 'failure') }} + uses: bitnami/support/.github/workflows/gchat-notification.yml@main + with: + workflow: ${{ github.workflow }} + job-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + secrets: + webhook-url: ${{ secrets.GCHAT_CONTENT_ALERTS_WEBHOOK_URL }} diff --git a/.github/workflows/push-tag.yml b/.github/workflows/push-tag.yml index 3270accce6..1cfb7816c9 100644 --- a/.github/workflows/push-tag.yml +++ b/.github/workflows/push-tag.yml @@ -86,3 +86,14 @@ jobs: git tag ${CHART}/${chart_version} git push --tags fi + notify: + name: Send notification + needs: + - push-tag + if: ${{ always() && (needs.push-tag.result == 'failure') }} + uses: bitnami/support/.github/workflows/gchat-notification.yml@main + with: + workflow: ${{ github.workflow }} + job-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + secrets: + webhook-url: ${{ secrets.GCHAT_CONTENT_ALERTS_WEBHOOK_URL }}