File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 - " utils/**/*.ts"
1414 - " utils/package.json"
1515 - " package.json"
16- - " package-lock.json"
1716 - " .github/workflows/ci.yml"
1817 pull_request :
1918 branches : ["*"]
2322 - " utils/**/*.ts"
2423 - " utils/**/package.json"
2524 - " package.json"
26- - " package-lock.json"
2725 - " .github/workflows/ci.yml"
2826 types :
2927 - opened
@@ -113,10 +111,20 @@ jobs:
113111 - run : npm ci
114112
115113 - run : >
114+ changed_paths=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }})
115+
116+ # run everything?
117+ if echo "$changed_paths" | grep -qE '^(package\.json|\.github/workflows/ci\.yml)$'; then
118+ npm run test --workspaces
119+ exit 0
120+ fi
121+
122+ # run for specific workspace(s)
116123 npm run test $(
117- git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
118- | grep '^recipes/'
119- | cut -d/ -f1,2
124+ echo "$changed_paths" \
125+ | awk -F/ '
126+ /^packages\// { print "--workspace=" $1 "/" $2 }
127+ /^utils\// { print "--workspace=utils" }
128+ ' \
120129 | sort -u
121- | sed 's/^/--workspace=/'
122130 )
You can’t perform that action at this time.
0 commit comments