Skip to content

Commit f998c67

Browse files
committed
Test README generation with actual tsconfig.json
1 parent a24dc19 commit f998c67

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

.github/actions/setup/action.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -116,27 +116,26 @@ runs:
116116
cp packages/tsconfig.json packages/tsconfig.tmp.json
117117
exit 0
118118
else
119-
yarn workspaces list --json -R --since=$UPSTREAM_BRANCH \
120-
| jq -csr '.' \
121-
| jq '{
122-
files: [],
123-
include: [],
124-
references: [
125-
{
126-
path: "core/factories"
127-
},
128-
{
129-
path: .[]
130-
| .location
131-
| select(
132-
startswith("packages/sources")
133-
or startswith("packages/composites")
134-
or startswith("packages/targets")
135-
)
136-
| match("packages/(.*)").captures[0].string
137-
}
138-
]
139-
}' \
119+
jq \
120+
--arg changed_workspaces "$(yarn workspaces list --json -R --since=$UPSTREAM_BRANCH)" \
121+
'[$changed_workspaces | split("\n")[] | fromjson.location] as $changed_locations |
122+
.references = [
123+
.references[] |
124+
select(
125+
(
126+
.path
127+
| startswith("./sources")
128+
or startswith("./composites")
129+
or startswith("./targets")
130+
or startswith("./non-deployable")
131+
| not
132+
) or (
133+
(.path | "packages" + .[1:]) as $location
134+
| $changed_locations
135+
| any($location == .)
136+
)
137+
)
138+
]' packages/tsconfig.json \
140139
> packages/tsconfig.tmp.json
141140
fi
142141

0 commit comments

Comments
 (0)