Skip to content

Commit 6edb926

Browse files
authored
feat: ignore private or ignored packages for comment (#105)
changesets/bot#44
1 parent 567c77a commit 6edb926

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.changeset/quick-ligers-flash.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"changesets-gitlab": minor
3+
---
4+
5+
feat: ignore private or ignored packages for comment

src/get-changed-packages.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,14 @@ export const getChangedPackages = async ({
181181
throw new Error('an error occurred when fetching files')
182182
}
183183

184+
const config = await configPromise.then(rawConfig =>
185+
parseConfig(rawConfig, packages),
186+
)
187+
184188
const releasePlan = assembleReleasePlan(
185189
await Promise.all(changesetPromises),
186190
packages,
187-
await configPromise.then(rawConfig => parseConfig(rawConfig, packages)),
191+
config,
188192
await preStatePromise,
189193
)
190194

@@ -194,7 +198,13 @@ export const getChangedPackages = async ({
194198
: packages.packages.filter(pkg =>
195199
changedFiles.some(changedFile => changedFile.includes(pkg.dir)),
196200
)
197-
).map(x => x.packageJson.name),
201+
)
202+
.filter(
203+
pkg =>
204+
pkg.packageJson.private !== true &&
205+
!config.ignore.includes(pkg.packageJson.name),
206+
)
207+
.map(x => x.packageJson.name),
198208
releasePlan,
199209
}
200210
}

0 commit comments

Comments
 (0)