Fixed an issue with treating single package repositories without changesets as versioned at all times (#41)

This commit is contained in:
Mateusz Burzyński
2020-07-07 10:06:02 +10:00
committed by GitHub
parent a56ea2d6eb
commit bfeb9e077e
2 changed files with 16 additions and 7 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+10 -1
View File
@@ -119,12 +119,21 @@ export async function runPublish({
"This is probably a bug in the action, please open an issue" "This is probably a bug in the action, please open an issue"
); );
} }
const pkg = packages[0]; let pkg = packages[0];
let newTagRegex = /New tag:/;
for (let line of changesetPublishOutput.stdout.split("\n")) {
let match = line.match(newTagRegex);
if (match) {
releasedPackages.push(pkg); releasedPackages.push(pkg);
await createRelease(octokit, { await createRelease(octokit, {
pkg, pkg,
tagName: `v${pkg.packageJson.version}`, tagName: `v${pkg.packageJson.version}`,
}); });
break;
}
}
} }
if (releasedPackages.length) { if (releasedPackages.length) {