Skip to content

Commit 73e2ef5

Browse files
add tag
1 parent c9b9cb4 commit 73e2ef5

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/scripts/first-release-publish.mjs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,19 @@ for (const pkg of missingPackages) {
123123
process.exit(result.status ?? 1);
124124
}
125125

126-
console.log(`New tag: ${pkg.name}@${pkg.version}`);
126+
const tagName = `${pkg.name}@${pkg.version}`;
127+
const tag = spawnSync("git", ["tag", tagName], {
128+
encoding: "utf8",
129+
stdio: ["inherit", "pipe", "pipe"],
130+
});
131+
132+
process.stdout.write(tag.stdout);
133+
process.stderr.write(tag.stderr);
134+
135+
if (tag.status !== 0) {
136+
console.error(`${pkg.name} was published, but git tag ${tagName} could not be created.`);
137+
process.exit(tag.status ?? 1);
138+
}
139+
140+
console.log(`New tag: ${tagName}`);
127141
}

0 commit comments

Comments
 (0)