File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 - " utils/**/*.ts"
1616 - " utils/package.json"
1717 - " package.json"
18- - " package-lock.json"
1918 - " .github/workflows/ci.yml"
2019 pull_request :
2120 branches : ["*"]
2726 - " utils/**/*.ts"
2827 - " utils/**/package.json"
2928 - " package.json"
30- - " package-lock.json"
3129 - " .github/workflows/ci.yml"
3230 types :
3331 - opened
@@ -117,10 +115,20 @@ jobs:
117115 - run : npm ci
118116
119117 - run : >
118+ changed_paths=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }})
119+
120+ # run everything?
121+ if echo "$changed_paths" | grep -qE '^(package\.json|\.github/workflows/ci\.yml)$'; then
122+ npm run test --workspaces
123+ exit 0
124+ fi
125+
126+ # run for specific workspace(s)
120127 npm run test $(
121- git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
122- | grep '^recipes/'
123- | cut -d/ -f1,2
128+ echo "$changed_paths" \
129+ | awk -F/ '
130+ /^packages\// { print "--workspace=" $1 "/" $2 }
131+ /^utils\// { print "--workspace=utils" }
132+ ' \
124133 | sort -u
125- | sed 's/^/--workspace=/'
126134 )
You can’t perform that action at this time.
0 commit comments