Skip to content
Merged
Prev Previous commit
Next Next commit
fix: simplify pushTags function by using HEAD directly for tag retrieval
  • Loading branch information
WeslleyNasRocha authored and JounQin committed Apr 1, 2025
commit e1de87ae6d6833137235664db73e663f633b7c06
23 changes: 8 additions & 15 deletions src/git-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,19 @@ export const push = async (
}

export const pushTags = async () => {
// Get the commit hash
const { stdout: commitHash } = await execWithOutput("git", [
"rev-parse",
"HEAD",
]);
// Get the tags that contain the commit
const { stdout: tags } = await execWithOutput("git", [
"--no-pager",
"tag",
"--contains",
commitHash,
]);
const { stdout: tags } = await execWithOutput('git', [
'--no-pager',
'tag',
`HEAD`,
])
// Separate the tags into a list
const tagList = tags.split("\n");
const tagList = tags.split('\n')
// Push the tags individually to the remote
for (const tag of tagList) {
await exec("git", ["push", "origin", tag]);
await exec('git', ['push', 'origin', tag])
}
};

}

export const switchToMaybeExistingBranch = async (branch: string) => {
const { stderr } = await execWithOutput('git', ['checkout', branch], {
Expand Down