Skip to content

Commit 4c1e50f

Browse files
committed
chore: slack notification
1 parent 3508d3b commit 4c1e50f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/audit-dependencies.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,28 @@ jobs:
3434
run: ./.github/workflows/audit-dependencies.sh ${{ inputs.audit-level }}
3535

3636
- name: Failure output
37+
id: failure_output
3738
if: failure()
3839
run: |
3940
echo "Vulnerabilities found."
4041
cat audit_output.json
42+
# Output json content to GitHub Actions output
43+
echo "audit_output=$(cat audit_output.json)" >> $GITHUB_OUTPUT
44+
45+
- name: Slack notification on failure
46+
if: failure()
47+
uses: slackapi/[email protected]
48+
with:
49+
webhook: ${{ secrets.SLACK_TEST_WEBHOOK_URL }}
50+
webhook-type: incoming-webhook
51+
payload: |
52+
text: "🚨 *Dependency Vulnerabilities Found"
53+
blocks:
54+
- type: "section"
55+
text:
56+
type: "mrkdwn"
57+
text: "Actionable vulnerabilities found: ${{ steps.failure_output.outputs.audit_output }}"
58+
- type: "section"
59+
text:
60+
type: "mrkdwn"
61+
text: "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"

0 commit comments

Comments
 (0)