diff --git a/package.json b/package.json index 5b4821a37..9ff6c51e3 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ "start:files": "yarn workspace @standardnotes/files-server start", "start:files-worker": "yarn workspace @standardnotes/files-server worker", "start:api-gateway": "yarn workspace @standardnotes/api-gateway start", - "release:prod": "lerna version --conventional-graduate --conventional-commits --yes -m \"chore(release): publish new version\"" + "release:prod": "lerna version --conventional-graduate --conventional-commits --yes -m \"chore(release): publish new version\"", + "postversion": "./scripts/push-tags-one-by-one.sh" }, "devDependencies": { "@commitlint/cli": "^17.0.2", diff --git a/scripts/push-tags-one-by-one.sh b/scripts/push-tags-one-by-one.sh new file mode 100755 index 000000000..be6050684 --- /dev/null +++ b/scripts/push-tags-one-by-one.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# source: https://github.com/lerna/lerna/issues/2218#issuecomment-771876933 +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows +# > "Note: An event will not be created when you create more than three tags at once." +# GitHub workflows will not run if a commit includes more than 3 tags at once. This +# fix pushes tags up one by one. + +# get all tags on this commit +TAGS=$(git tag --points-at HEAD | cat) + +# only push tags one by one if there are more than 3 +if (($(echo "$TAGS"| wc -l) > 3)) +then + echo "Pushing tags one by one to avoid GitHub webhook limit of 3" + echo "$TAGS" | while read line ; do git push origin --no-follow-tags $line; done +fi \ No newline at end of file