Skip to content

Commit bc5a635

Browse files
authored
Fail release early if packages aren't published (#1071)
1 parent d982e98 commit bc5a635

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,25 @@ jobs:
3333
cache: pnpm
3434
- name: Install dependencies
3535
run: pnpm install --frozen-lockfile
36+
- name: Verify all packages exist on npm
37+
run: |
38+
MISSING=()
39+
for pkg in $(pnpm -r --silent exec -- node -e "
40+
const p = require('./package.json');
41+
if (!p.private) process.stdout.write(p.name + '\n');
42+
"); do
43+
if ! npm view "$pkg" > /dev/null 2>&1; then
44+
MISSING+=("$pkg")
45+
fi
46+
done
47+
if [ ${#MISSING[@]} -gt 0 ]; then
48+
echo "::error::The following packages are not yet published on npm:"
49+
for pkg in "${MISSING[@]}"; do
50+
echo "::error:: - $pkg"
51+
done
52+
exit 1
53+
fi
54+
echo "All packages exist on npm."
3655
- name: Create Release Pull Request or Publish to npm
3756
id: changesets
3857
uses: changesets/action@v1

0 commit comments

Comments
 (0)