Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Slack notification optional in notify-ci-result action. #306

Merged
merged 1 commit into from
Jul 29, 2024
Merged
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
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