From dcf978d74395cb4439ddf764dc15a0844e033f87 Mon Sep 17 00:00:00 2001 From: Brian Shand Date: Fri, 14 Nov 2025 10:27:39 +0000 Subject: [PATCH] GitHub Actions: Disable Slack notifications --- .github/workflows/static_code_analysis.yml | 74 ++++++------ .github/workflows/tests.yml | 128 ++++++++++----------- 2 files changed, 101 insertions(+), 101 deletions(-) diff --git a/.github/workflows/static_code_analysis.yml b/.github/workflows/static_code_analysis.yml index 55c2b7d6..9e124015 100644 --- a/.github/workflows/static_code_analysis.yml +++ b/.github/workflows/static_code_analysis.yml @@ -30,40 +30,40 @@ jobs: run: bundle exec bundle-audit check --update --ignore CVE-2024-6484 # run: bundle exec bundle-audit check --update - notify: - # Run only on main, but regardless of whether tests past: - if: ${{ always() }} - # if: ${{ always() && github.ref == 'refs/heads/main' }} - - needs: - - brakeman - - bundle-audit - - runs-on: ubuntu-latest - - steps: - - uses: 8398a7/action-slack@v3 - with: - status: custom - fields: workflow,commit,author - custom_payload: | - { - channel: '${{ secrets.SLACK_CHANNEL }}', - username: 'GitHub CI', - icon_emoji: ':robot_face:', - attachments: [{ - text: '${{ github.event.commits[0].message }}', - fields: [ - { title: 'Author', value: '${{ github.actor }}', short: true }, - { title: 'Revision', value: '${{ github.sha }}', short: true } - ] - },{ - color: '${{ needs.brakeman.result }}' === 'success' ? 'good' : '${{ needs.brakeman.result }}' === 'failure' ? 'danger' : 'warning', - text: `Brakeman checks returned *${{ needs.brakeman.result }}*.` - },{ - color: '${{ needs.bundle-audit.result }}' === 'success' ? 'good' : '${{ needs.bundle-audit.result }}' === 'failure' ? 'danger' : 'warning', - text: `Bundle Audit checks returned *${{ needs.bundle-audit.result }}*.` - }] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} +# notify: +# # Run only on main, but regardless of whether tests past: +# if: ${{ always() }} +# # if: ${{ always() && github.ref == 'refs/heads/main' }} +# +# needs: +# - brakeman +# - bundle-audit +# +# runs-on: ubuntu-latest +# +# steps: +# - uses: 8398a7/action-slack@v3 +# with: +# status: custom +# fields: workflow,commit,author +# custom_payload: | +# { +# channel: '${{ secrets.SLACK_CHANNEL }}', +# username: 'GitHub CI', +# icon_emoji: ':robot_face:', +# attachments: [{ +# text: '${{ github.event.commits[0].message }}', +# fields: [ +# { title: 'Author', value: '${{ github.actor }}', short: true }, +# { title: 'Revision', value: '${{ github.sha }}', short: true } +# ] +# },{ +# color: '${{ needs.brakeman.result }}' === 'success' ? 'good' : '${{ needs.brakeman.result }}' === 'failure' ? 'danger' : 'warning', +# text: `Brakeman checks returned *${{ needs.brakeman.result }}*.` +# },{ +# color: '${{ needs.bundle-audit.result }}' === 'success' ? 'good' : '${{ needs.bundle-audit.result }}' === 'failure' ? 'danger' : 'warning', +# text: `Bundle Audit checks returned *${{ needs.bundle-audit.result }}*.` +# }] +# } +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bdb4bcd4..dfc04156 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -164,67 +164,67 @@ jobs: if: ${{ needs.remaining_test_matrix.result != 'success' }} run: exit 1 - notify: - # Run only on master, but regardless of whether tests past: - if: ${{ always() }} - # if: ${{ always() && github.ref == 'refs/heads/master' }} - - needs: - - integration_tests - - remaining_tests - - runs-on: ubuntu-latest - - steps: - - uses: actions/setup-node@v3 - # with: - # node-version: '16.x' - - id: slack-payload-generator - env: - COMMIT_MESSAGE: ${{ github.event.commits[0].message }} - run: |- - node -e " - const passed = '${{ needs.integration_tests.result }}' === 'success' && '${{ needs.remaining_tests.result }}' === 'success' - - const text = process.env.COMMIT_MESSAGE - - let attachments = [ - { - fallback: text, - text: text, - fields: [ - { title: 'Author', value: '${{ github.actor }}', short: true }, - { title: 'Revision', value: '${{ github.sha }}', short: true } - ] - // ts: @commit.author[:time].to_i - } - ] - - if (passed) { - attachments.push({ - color: 'good', - text: 'Tests passed' - }) - } else { - attachments.push({ - color: 'danger', - text: 'Test(s) failed' - }) - } - - let payload = { - channel: '${{ secrets.SLACK_CHANNEL }}', - username: 'GitHub CI', - icon_emoji: ':robot_face:', - attachments: attachments - } - - console.log('json=' + JSON.stringify(payload)) - " >> "$GITHUB_OUTPUT" - - uses: 8398a7/action-slack@v3 - with: - status: custom - fields: workflow,commit,author - custom_payload: ${{ steps.slack-payload-generator.outputs.json }} - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} +# notify: +# # Run only on master, but regardless of whether tests past: +# if: ${{ always() }} +# # if: ${{ always() && github.ref == 'refs/heads/master' }} +# +# needs: +# - integration_tests +# - remaining_tests +# +# runs-on: ubuntu-latest +# +# steps: +# - uses: actions/setup-node@v3 +# # with: +# # node-version: '16.x' +# - id: slack-payload-generator +# env: +# COMMIT_MESSAGE: ${{ github.event.commits[0].message }} +# run: |- +# node -e " +# const passed = '${{ needs.integration_tests.result }}' === 'success' && '${{ needs.remaining_tests.result }}' === 'success' +# +# const text = process.env.COMMIT_MESSAGE +# +# let attachments = [ +# { +# fallback: text, +# text: text, +# fields: [ +# { title: 'Author', value: '${{ github.actor }}', short: true }, +# { title: 'Revision', value: '${{ github.sha }}', short: true } +# ] +# // ts: @commit.author[:time].to_i +# } +# ] +# +# if (passed) { +# attachments.push({ +# color: 'good', +# text: 'Tests passed' +# }) +# } else { +# attachments.push({ +# color: 'danger', +# text: 'Test(s) failed' +# }) +# } +# +# let payload = { +# channel: '${{ secrets.SLACK_CHANNEL }}', +# username: 'GitHub CI', +# icon_emoji: ':robot_face:', +# attachments: attachments +# } +# +# console.log('json=' + JSON.stringify(payload)) +# " >> "$GITHUB_OUTPUT" +# - uses: 8398a7/action-slack@v3 +# with: +# status: custom +# fields: workflow,commit,author +# custom_payload: ${{ steps.slack-payload-generator.outputs.json }} +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}