Skip to content

Commit

Permalink
Make Slack notification optional in notify-ci-result action.
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rj1k committed Jul 26, 2024
1 parent 5a0f207 commit 197c3c2
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 197c3c2

Please sign in to comment.