@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 03:37 UTC

next
yml 96 lines 3.08 KB
Raw
1 name: Audit Typescript SDK
2
3 on:
4 push:
5 branches: [master, next, main]
6 paths:
7 - 'ts/**'
8 - '.github/actions/setup-node-pnpm-bun/action.yml'
9 - '.github/workflows/ts.audit.yml'
10 - 'mise.toml'
11 - 'mise.lock'
12 - 'package.json'
13 - 'pnpm-lock.yaml'
14 - 'pnpm-workspace.yaml'
15 pull_request:
16 branches: [master, next, main]
17 paths:
18 - 'ts/**'
19 - '.github/actions/setup-node-pnpm-bun/action.yml'
20 - '.github/workflows/ts.audit.yml'
21 - 'mise.toml'
22 - 'mise.lock'
23 - 'package.json'
24 - 'pnpm-lock.yaml'
25 - 'pnpm-workspace.yaml'
26
27 concurrency:
28 group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
29 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
30
31 permissions:
32 contents: read
33
34 jobs:
35 audit:
36 name: Audit
37 runs-on: ubuntu-latest
38 permissions:
39 contents: read
40 pull-requests: write
41
42 steps:
43 - name: Checkout Code
44 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
45
46 - name: Setup Node.js, pnpm, Bun
47 uses: ./.github/actions/setup-node-pnpm-bun
48 with:
49 enable-caching: 'false'
50
51 - name: Verify mise.lock is fresh
52 run: |
53 mise lock
54 git diff --exit-code mise.lock
55
56 - name: Run pnpm audit (production dependencies only)
57 id: audit
58 continue-on-error: true
59 run: pnpm audit --prod > audit-output.txt 2>&1
60
61 - name: Comment on PR if audit failed
62 if: steps.audit.outcome == 'failure' && github.event_name == 'pull_request'
63 run: |
64 {
65 echo "⚠️ **Security Audit Warning**"
66 echo ""
67 echo "The \`pnpm audit --prod\` check found security vulnerabilities in production dependencies."
68 echo ""
69 echo "Please review and fix the vulnerabilities. You can try running:"
70 echo "\`\`\`bash"
71 echo "pnpm audit --fix --prod"
72 echo "\`\`\`"
73 echo ""
74 echo "<details>"
75 echo "<summary>Audit output</summary>"
76 echo ""
77 echo "\`\`\`"
78 cat audit-output.txt
79 echo "\`\`\`"
80 echo ""
81 echo "</details>"
82 } > audit-comment.txt
83
84 - name: Post audit comment to PR
85 if: steps.audit.outcome == 'failure' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
86 uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
87 with:
88 file-path: audit-comment.txt
89 comment-tag: pnpm-audit-security-warning
90
91 - name: Fail on high/critical advisories
92 # No --ignore here: the flag writes the advisory into pnpm-workspace.yaml's
93 # auditConfig and exits 0 regardless of what else is outstanding, which
94 # silently disarms this gate. Advisories that genuinely cannot be fixed by
95 # a version bump belong in `auditConfig.ignoreGhsas`, with a comment.
96 run: pnpm audit --prod --audit-level=high