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.

add pnpm-workspace

Pedro Ladeiraa5513aaf34b6
diff --git a/.deepsec/pnpm-workspace.yaml b/.deepsec/pnpm-workspace.yaml
new file mode 100644
index 0000000000..58cbc44102
--- /dev/null
+++ b/.deepsec/pnpm-workspace.yaml
@@ -0,0 +1,3 @@
+# Stop pnpm from walking up into the Dub monorepo workspace.
+packages:
+ - "."
diff --git a/.github/workflows/deepsec-pr.yml b/.github/workflows/deepsec-pr.yml
index 2c39b57b90..91c7df7377 100644
--- a/.github/workflows/deepsec-pr.yml
+++ b/.github/workflows/deepsec-pr.yml
@@ -41,7 +41,9 @@ jobs:
cache-dependency-path: .deepsec/pnpm-lock.yaml
- name: Install DeepSec
- run: pnpm install --frozen-lockfile
+ run: |
+ pnpm install --frozen-lockfile --ignore-workspace
+ test -x node_modules/.bin/deepsec
- name: Install Codex CLI
run: npm install -g @openai/codex
@@ -68,7 +70,7 @@ jobs:
env:
AI_GATEWAY_API_KEY: ${{ secrets.DEEPSEC_AI_GATEWAY_API_KEY }}
run: |
- pnpm deepsec process \
+ pnpm exec deepsec process \
--project-id web \
--files-from pr-files.txt \
--comment-out "${{ github.workspace }}/comment.md"
@@ -107,3 +109,43 @@ jobs:
repo: context.repo.repo,
body: fs.readFileSync('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("comment.md", "utf8").slice(0, 2200);
+ 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
diff --git a/.github/workflows/deepsec.yml b/.github/workflows/deepsec.yml
index 8d8098cd0d..eda7d663e8 100644
--- a/.github/workflows/deepsec.yml
+++ b/.github/workflows/deepsec.yml
@@ -42,7 +42,9 @@ jobs:
cache-dependency-path: .deepsec/pnpm-lock.yaml
- name: Install DeepSec
- run: pnpm install --frozen-lockfile
+ run: |
+ pnpm install --frozen-lockfile --ignore-workspace
+ test -x node_modules/.bin/deepsec
- name: Restore file records
uses: actions/cache@v4
@@ -53,13 +55,13 @@ jobs:
deepsec-web-files-
- name: Scan
- run: pnpm deepsec scan --project-id web
+ run: pnpm exec deepsec scan --project-id web
- name: Process in Vercel Sandboxes
id: process
continue-on-error: true
run: |
- pnpm deepsec sandbox process \
+ pnpm exec deepsec sandbox process \
--project-id web \
--sandboxes 10 \
--concurrency 4 \
@@ -69,17 +71,17 @@ jobs:
id: revalidate
if: ${{ !cancelled() }}
continue-on-error: true
- run: pnpm deepsec revalidate --project-id web --min-severity HIGH
+ run: pnpm exec deepsec revalidate --project-id web --min-severity HIGH
- name: Export findings
if: ${{ !cancelled() }}
run: |
- pnpm deepsec export \
+ pnpm exec deepsec export \
--project-id web \
--format json \
--min-severity HIGH \
--out findings.json
- pnpm deepsec export \
+ pnpm exec deepsec export \
--project-id web \
--format md-dir \
--min-severity HIGH \