diff --git a/.github/workflows/daily-cli-tests.yml b/.github/workflows/daily-cli-tests.yml index 3ca488a01..fc2ff7f74 100644 --- a/.github/workflows/daily-cli-tests.yml +++ b/.github/workflows/daily-cli-tests.yml @@ -48,3 +48,21 @@ jobs: kosli_reporting_api_token: ${{ secrets.KOSLI_PUBLIC_API_TOKEN }} kosli_querying_api_token: ${{ secrets.KOSLI_API_TOKEN_PROD }} sonarqube_token: ${{ secrets.KOSLI_SONARQUBE_TOKEN }} + + slack-notification-on-failure: + runs-on: ubuntu-24.04 + permissions: + actions: read + contents: read + needs: + [ + set-trail-name, + test, + ] + if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && github.ref == 'refs/heads/master' }} + steps: + - name: Slack Notification on Failure + uses: kosli-dev/reusable-actions/.github/actions/send-ci-failure-slack-message@main + with: + slack_url: ${{ secrets.MERKELY_SLACK_CI_FAILURES_WEBHOOK }} + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c5bbe68df..6788a9479 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,3 +88,23 @@ jobs: slack_channel: ci-failures kosli_api_token: ${{ secrets.KOSLI_PUBLIC_API_TOKEN }} snyk_token: ${{ secrets.SNYK_TOKEN }} + + slack-notification-on-failure: + runs-on: ubuntu-24.04 + permissions: + actions: read + contents: read + needs: + [ + pre-build, + init-kosli, + test, + docker + ] + if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && github.ref == 'refs/heads/master' }} + steps: + - name: Slack Notification on Failure + uses: kosli-dev/reusable-actions/.github/actions/send-ci-failure-slack-message@main + with: + slack_url: ${{ secrets.MERKELY_SLACK_CI_FAILURES_WEBHOOK }} + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bfe84fe6e..529078e35 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -250,3 +250,31 @@ jobs: tag: ${{ needs.pre-build.outputs.tag }} AWS_ACCOUNT_ID: 585008075785 AWS_REGION: eu-central-1 + + slack-notification-on-failure: + runs-on: ubuntu-24.04 + permissions: + actions: read + contents: read + needs: + [ + pre-build, + init-kosli, + never-alone-trail, + test, + docker, + goreleaser, + binary-provenance, + homebrew-pr, + docs-gen, + evidence-reporter-upload-package-and-deploy, + environment-reporter-upload-package-and-deploy, + environment-reporter-upload-layer + ] + if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && github.ref == 'refs/heads/master' }} + steps: + - name: Slack Notification on Failure + uses: kosli-dev/reusable-actions/.github/actions/send-ci-failure-slack-message@main + with: + slack_url: ${{ secrets.MERKELY_SLACK_CI_FAILURES_WEBHOOK }} + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a4a16e53e..19e71a19c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,17 +97,7 @@ jobs: --flow ${{ inputs.FLOW_NAME }} --trail ${{ inputs.TRAIL_NAME }} --org ${{ inputs.KOSLI_ORG }} - --compliant=${{ steps.lint.outcome == 'success' }} - - - name: Slack Notification on Failure - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: ${{ secrets.slack_channel }} - SLACK_COLOR: ${{ job.status }} - SLACK_TITLE: Lint Failed in CLI repository - SLACK_USERNAME: GithubActions - SLACK_WEBHOOK: ${{ secrets.slack_webhook }} + --compliant=${{ steps.lint.outcome == 'success' }} test: name: Test @@ -176,16 +166,6 @@ jobs: if: ${{ inputs.report_results }} uses: codecov/codecov-action@v4 - - name: Slack Notification on Failure - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: ${{ secrets.slack_channel }} - SLACK_COLOR: ${{ job.status }} - SLACK_TITLE: Test Failed in CLI repository - SLACK_USERNAME: GithubActions - SLACK_WEBHOOK: ${{ secrets.slack_webhook }} - snyk-code-test: if: ${{ inputs.run_snyk }} name: Snyk Code Test @@ -222,16 +202,6 @@ jobs: # --trail ${{ inputs.TRAIL_NAME }} # --scan-results snyk-code.json # --org ${{ inputs.KOSLI_ORG }} - - # - name: Slack Notification on Failure - # if: ${{ failure() }} - # uses: rtCamp/action-slack-notify@v2 - # env: - # SLACK_CHANNEL: ${{ secrets.slack_channel }} - # SLACK_COLOR: ${{ job.status }} - # SLACK_TITLE: Snyk Code Failed in CLI repository - # SLACK_USERNAME: GithubActions - # SLACK_WEBHOOK: ${{ secrets.slack_webhook }} snyk-dependency-test: if: ${{ inputs.run_snyk }} @@ -269,13 +239,4 @@ jobs: # --trail ${{ inputs.TRAIL_NAME }} # --scan-results snyk-dependency.json # --org ${{ inputs.KOSLI_ORG }} - - # - name: Slack Notification on Failure - # if: ${{ failure() }} - # uses: rtCamp/action-slack-notify@v2 - # env: - # SLACK_CHANNEL: ${{ secrets.slack_channel }} - # SLACK_COLOR: ${{ job.status }} - # SLACK_TITLE: Snyk Test Failed in CLI repository - # SLACK_USERNAME: GithubActions - # SLACK_WEBHOOK: ${{ secrets.slack_webhook }} +