Skip to content

Commit dbdae2e

Browse files
committed
Raising new issue when audit fails
1 parent 59264c2 commit dbdae2e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
security:
4949
name: Security Audit
5050
runs-on: ubuntu-latest
51+
permissions:
52+
issues: write
53+
contents: read
5154
steps:
5255
- name: Checkout code
5356
uses: actions/checkout@v4
@@ -65,4 +68,14 @@ jobs:
6568
run: pnpm install --frozen-lockfile
6669

6770
- name: Security audit
68-
run: pnpm audit
71+
run: |
72+
if ! pnpm audit --audit-level moderate; then
73+
echo "Security audit failed - creating issue"
74+
gh issue create \
75+
--title "Security audit failed on $(date +%Y-%m-%d)" \
76+
--label "security audit" \
77+
--body "Security audit failed in CI. Please review and fix vulnerabilities."
78+
exit 1
79+
fi
80+
env:
81+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)