Skip to content

Commit f3ace8b

Browse files
committed
Release-drafter template and resilient pnpm audit
Add a release-drafter template to format release notes with "What's Changed" and "Contributors" sections. Update the CI security workflow's pnpm audit step to run under bash, capture output and exit status, and treat ERR_PNPM_AUDIT_BAD_RESPONSE as a transient upstream outage (skip failing the job). Real audit findings and other errors still cause the job to fail.
1 parent 0fc95fc commit f3ace8b

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.github/release-drafter.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
name-template: 'v$RESOLVED_VERSION'
22
tag-template: 'v$RESOLVED_VERSION'
3+
template: |
4+
## What's Changed
5+
6+
$CHANGES
7+
8+
## Contributors
9+
10+
$CONTRIBUTORS
11+
312
change-template: '- $TITLE (#$NUMBER)'
413
no-changes-template: '- No user-facing changes in this release.'
514
version-resolver:

.github/workflows/security.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,25 @@ jobs:
4040
cache: pnpm
4141
- run: pnpm install --frozen-lockfile
4242
- name: pnpm audit
43-
run: pnpm audit --audit-level moderate
43+
shell: bash
44+
run: |
45+
set +e
46+
output="$(pnpm audit --audit-level moderate 2>&1)"
47+
status=$?
48+
set -e
49+
50+
echo "$output"
51+
52+
if [ "$status" -eq 0 ]; then
53+
exit 0
54+
fi
55+
56+
# npm audit API occasionally returns 500 and pnpm surfaces it as
57+
# ERR_PNPM_AUDIT_BAD_RESPONSE. Do not fail CI for transient upstream outages.
58+
if echo "$output" | grep -q "ERR_PNPM_AUDIT_BAD_RESPONSE"; then
59+
echo "Skipping failure due to transient npm audit endpoint outage."
60+
exit 0
61+
fi
62+
63+
# Preserve failures for real audit findings or other errors.
64+
exit "$status"

0 commit comments

Comments
 (0)