Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions .github/workflows/static_code_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
128 changes: 64 additions & 64 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Loading