Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

remove slack notification

Pedro Ladeiradd9d7c887de3
diff --git a/.github/workflows/deepsec-pr.yml b/.github/workflows/deepsec-pr.yml
index 6ec4aacea9..774e8c148f 100644
--- a/.github/workflows/deepsec-pr.yml
+++ b/.github/workflows/deepsec-pr.yml
@@ -114,48 +114,3 @@ jobs:
repo: context.repo.repo,
body: fs.readFileSync('.deepsec/comment.md', 'utf8'),
});
-
- - name: Notify Slack
- if: steps.dl.outcome == 'success'
- env:
- DEEPSEC_SLACK_HOOK: ${{ secrets.DEEPSEC_SLACK_HOOK }}
- PR_URL: ${{ github.event.pull_request.html_url }}
- PR_TITLE: ${{ github.event.pull_request.title }}
- PR_NUMBER: ${{ github.event.pull_request.number }}
- run: |
- if [ -z "$DEEPSEC_SLACK_HOOK" ]; then
- echo "DEEPSEC_SLACK_HOOK is not set; skipping Slack notify."
- exit 0
- fi
- node <<'EOF'
- const fs = require("fs");
- const hook = process.env.DEEPSEC_SLACK_HOOK;
- const prUrl = process.env.PR_URL;
- const prTitle = (process.env.PR_TITLE || "PR").replace(/[<>&]/g, "");
- const prNumber = process.env.PR_NUMBER;
- const findings = fs
- .readFileSync(".deepsec/comment.md", "utf8")
- .slice(0, 2200)
- .replaceAll("&", "&amp;")
- .replaceAll("<", "&lt;")
- .replaceAll(">", "&gt;");
- const text = [
- `:alert: DeepSec findings on <${prUrl}|#${prNumber} ${prTitle}>`,
- "",
- findings,
- ].join("\n").slice(0, 2900);
-
- fetch(hook, {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({
- blocks: [{ type: "section", text: { type: "mrkdwn", text } }],
- }),
- }).then(async (res) => {
- if (!res.ok) {
- console.error(`Slack webhook failed (${res.status}): ${await res.text()}`);
- process.exit(1);
- }
- console.log("Posted DeepSec PR findings to Slack.");
- });
- EOF