From 55e26c050eb63479d262524a6ffee78a368674e6 Mon Sep 17 00:00:00 2001 From: Greg McKelvey Date: Wed, 2 Aug 2023 11:51:55 -0700 Subject: [PATCH] fix: :bug: Fix tags not triggering github create event --- .changeset/many-gifts-sort.md | 5 +++++ src/gitUtils.ts | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/many-gifts-sort.md diff --git a/.changeset/many-gifts-sort.md b/.changeset/many-gifts-sort.md new file mode 100644 index 00000000..7e6086a9 --- /dev/null +++ b/.changeset/many-gifts-sort.md @@ -0,0 +1,5 @@ +--- +"@changesets/action": patch +--- + +Fix tags not triggering github create event diff --git a/src/gitUtils.ts b/src/gitUtils.ts index b15151ab..9bf7a26a 100644 --- a/src/gitUtils.ts +++ b/src/gitUtils.ts @@ -29,8 +29,17 @@ export const push = async ( ); }; +/** + * Push new tags 1 by 1 to avoid github create event limits + */ export const pushTags = async () => { - await exec("git", ["push", "origin", "--tags"]); + const tagsOutput = await getExecOutput("git tag --contains HEAD"); + const tagsArray = tagsOutput.stdout.split("\n").filter(Boolean); + await Promise.all( + tagsArray.map(async (tag) => { + await getExecOutput(`git push origin ${tag}`); + }) + ); }; export const switchToMaybeExistingBranch = async (branch: string) => {