Skip to content

Commit ef2aec6

Browse files
committed
ci: parse design-system pack output with jq instead of node
1 parent de6779a commit ef2aec6

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/ci-design-system-pack.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,18 @@ jobs:
3838
shell: bash
3939
run: |
4040
set -euo pipefail
41-
UNEXPECTED=$(pnpm -C packages/design-system pack --dry-run --json 2>/dev/null \
42-
| node -pe "
43-
const pkg = JSON.parse(require('fs').readFileSync(0, 'utf8'))
44-
pkg.files
45-
.map(f => f.path)
46-
.filter(p => p !== 'package.json' && p !== 'LICENSE' && !p.startsWith('src/css/') && !p.startsWith('src/icons/'))
47-
.join('\n')
48-
")
41+
UNEXPECTED=$(
42+
pnpm -C packages/design-system pack --dry-run --json |
43+
jq -r '
44+
.files[].path
45+
| select(
46+
. != "package.json"
47+
and . != "LICENSE"
48+
and (startswith("src/css/") | not)
49+
and (startswith("src/icons/") | not)
50+
)
51+
'
52+
)
4953
if [ -n "$UNEXPECTED" ]; then
5054
echo "::error title=Unexpected files in tarball::Packed tarball contains files outside src/css and src/icons:" >&2
5155
echo "$UNEXPECTED" >&2

0 commit comments

Comments
 (0)