mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
harden against tags pointing to non-commits
This commit is contained in:
+7
-1
@@ -32,7 +32,13 @@ await exec("changeset", ["git-tag"]);
|
|||||||
|
|
||||||
await exec(
|
await exec(
|
||||||
"git",
|
"git",
|
||||||
["push", "--force", "origin", `HEAD:refs/heads/${releaseLine}`],
|
[
|
||||||
|
"push",
|
||||||
|
"--force",
|
||||||
|
"--no-follow-tags",
|
||||||
|
"origin",
|
||||||
|
`HEAD:refs/heads/${releaseLine}`,
|
||||||
|
],
|
||||||
{
|
{
|
||||||
env: gitEnv,
|
env: gitEnv,
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -167,7 +167,7 @@ async function getTagCommits(cwd: string, tags: string[]) {
|
|||||||
if (tags.length === 0) {
|
if (tags.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const refs = tags.map((tag) => `refs/tags/${tag}^{commit}`);
|
const refs = tags.map((tag) => `refs/tags/${tag}^{}`);
|
||||||
const { stdout } = await getExecOutput(
|
const { stdout } = await getExecOutput(
|
||||||
"git",
|
"git",
|
||||||
["cat-file", "--batch-check=%(objectname) %(objecttype)"],
|
["cat-file", "--batch-check=%(objectname) %(objecttype)"],
|
||||||
|
|||||||
Reference in New Issue
Block a user