chore: adjust publishing workflows to account for more than 3 tags pushed at once
This commit is contained in:
@@ -25,7 +25,8 @@
|
|||||||
"reset": "find . -type dir -name node_modules | xargs rm -rf && rm -rf yarn.lock && yarn install",
|
"reset": "find . -type dir -name node_modules | xargs rm -rf && rm -rf yarn.lock && yarn install",
|
||||||
"release:prod": "lerna version --conventional-commits --yes -m \"chore(release): publish\"",
|
"release:prod": "lerna version --conventional-commits --yes -m \"chore(release): publish\"",
|
||||||
"release:beta": "lerna version --conventional-prerelease --conventional-commits --yes -m \"chore(release): publish\"",
|
"release:beta": "lerna version --conventional-prerelease --conventional-commits --yes -m \"chore(release): publish\"",
|
||||||
"version": "yarn install --no-immutable && git add yarn.lock"
|
"version": "yarn install --no-immutable && git add yarn.lock",
|
||||||
|
"postversion": "./scripts/push-tags-one-by-one.sh"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"@types/styled-components/@types/react": "17.0.2",
|
"@types/styled-components/@types/react": "17.0.2",
|
||||||
|
|||||||
16
scripts/push-tags-one-by-one.sh
Normal file
16
scripts/push-tags-one-by-one.sh
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user