Skip to content

Commit

Permalink
Merge pull request #306 from signalwire/notify-ci-result
Browse files Browse the repository at this point in the history
Make Slack notification optional in `notify-ci-result` action.
  • Loading branch information
andywolk authored Jul 29, 2024
2 parents 5a0f207 + 197c3c2 commit 041dfa6
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/actions/notify-ci-result/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ inputs:
required: false
description: message to send to slack or comment on PR
channel:
required: true
required: false
description: slack channel id to notify
slack_webhook_url:
required: true
required: false
description: slack webhook url
scan_build_path:
required: false
Expand Down Expand Up @@ -71,7 +71,12 @@ runs:
message: |
Scan-build ${{ inputs.message }}: [#${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
- name: Notify scan build result to slack
if: ${{ inputs.for == 'scan_build' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
if: >
${{ inputs.for == 'scan_build' &&
github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
inputs.channel != '' &&
slack_webhook_url.channel != '' }}
uses: signalwire/actions-template/.github/actions/slack@main
with:
CHANNEL: ${{ inputs.channel }}
Expand All @@ -92,7 +97,12 @@ runs:
message: |
Unit-Tests failed: [#${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
- name: Notify run tests result to slack
if: ${{ inputs.for == 'run_tests' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
if: >
${{ inputs.for == 'run_tests' &&
github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
inputs.channel != '' &&
slack_webhook_url.channel != '' }}
uses: signalwire/actions-template/.github/actions/slack@main
with:
CHANNEL: ${{ inputs.channel }}
Expand Down

0 comments on commit 041dfa6

Please sign in to comment.