Skip to content

add email & slack notifier action in github workflow #2280

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
36 changes: 36 additions & 0 deletions .github/workflows/weekly-security-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,39 @@ jobs:
go-version: ${{ steps.vars.outputs.go_version }}
- name: Run verify security target
run: make verify-security
# Send email notification
- name: Send Email Notification (Success)
if: success()
uses: cinotify/github-action@main
with:
to: '[email protected]'
subject: "Security scan completed successfully"
body: |
The security scan for branch ${{ matrix.branch }} completed successfully.
Please review the results if necessary.
type: 'text/plain'
- name: Send Email Notification (Failure)
if: failure()
uses: cinotify/github-action@main
with:
to: '[email protected]'
subject: "Security scan failed"
body: |
The security scan for branch ${{ matrix.branch }} has failed.
Please review the results and take appropriate action.
type: 'text/plain'
# Send slack notification
- name: Send Slack Notification (Success)
if: success()
uses: slackapi/slack-github-action@v1
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
channel: '#channel'
text: "Security scan completed successfully on branch ${{ matrix.branch }}."
- name: Send Slack Notification (Failure)
if: failure()
uses: slackapi/slack-github-action@v1
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
channel: '#channel'
text: "Security scan failed on branch ${{ matrix.branch }}. Please review the results."