Skip to content

Commit 631d254

Browse files
committed
fix(ci): avoid snapshot failure when app missing
1 parent 8a4b8f8 commit 631d254

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/snapshot.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,30 @@ jobs:
2323
run: pnpm build
2424
- name: Create snapshot
2525
id: snapshot
26-
continue-on-error: true
2726
env:
2827
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29-
run: pnpx pkg-pr-new@0.0.24 publish --pnpm --comment=off
28+
shell: bash
29+
run: |
30+
set +e
31+
pnpx pkg-pr-new@0.0.24 publish --pnpm --comment=off
32+
STATUS=$?
33+
if [ $STATUS -eq 0 ]; then
34+
echo "success=true" >> "$GITHUB_OUTPUT"
35+
else
36+
echo "success=false" >> "$GITHUB_OUTPUT"
37+
echo "pkg-pr-new failed (likely app not installed); falling back to artifacts."
38+
fi
39+
exit 0
3040
- name: Fallback snapshot artifacts
31-
if: steps.snapshot.outcome != 'success'
41+
if: steps.snapshot.outputs.success != 'true'
3242
shell: bash
3343
run: |
3444
set -euo pipefail
3545
mkdir -p artifacts
3646
cd packages/app
3747
npm pack --silent --pack-destination ../../artifacts
3848
- name: Upload snapshot artifacts
39-
if: steps.snapshot.outcome != 'success'
49+
if: steps.snapshot.outputs.success != 'true'
4050
uses: actions/upload-artifact@v4
4151
with:
4252
name: context-doc-snapshot

0 commit comments

Comments
 (0)