fix: pipeline script fixed
feat: auto version update chore: auto update version [skip ci] fix: auto version update fix: auto version update fix: auto version updatepull/1/head
parent
42969a5597
commit
06880e76d4
|
|
@ -23,7 +23,8 @@ steps:
|
||||||
image: node:lts-slim
|
image: node:lts-slim
|
||||||
commands:
|
commands:
|
||||||
- npm install --save-dev conventional-changelog-conventionalcommits @commitlint/config-conventional commitlint@latest
|
- npm install --save-dev conventional-changelog-conventionalcommits @commitlint/config-conventional commitlint@latest
|
||||||
- npx commitlint --from HEAD~1 --to HEAD --verbose
|
- "echo message: $CI_COMMIT_MESSAGE"
|
||||||
|
- "echo $CI_COMMIT_MESSAGE | npx commitlint"
|
||||||
when:
|
when:
|
||||||
- branch: [main, dev]
|
- branch: [main, dev]
|
||||||
event: push
|
event: push
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ steps:
|
||||||
- git remote set-url origin "https://$CI_COMMIT_AUTHOR:$GIT_PAT@$(echo $CI_REPO_CLONE_URL | cut -b9-)"
|
- git remote set-url origin "https://$CI_COMMIT_AUTHOR:$GIT_PAT@$(echo $CI_REPO_CLONE_URL | cut -b9-)"
|
||||||
- "git config --global user.name $CI_COMMIT_AUTHOR"
|
- "git config --global user.name $CI_COMMIT_AUTHOR"
|
||||||
- "git config --global user.email $CI_COMMIT_AUTHOR_EMAIL"
|
- "git config --global user.email $CI_COMMIT_AUTHOR_EMAIL"
|
||||||
- "git commit -am \"chore: auto update version [skip ci]\""
|
- "if ! git diff --exit-code; then git commit -am \"chore: auto update version [skip ci]\" ; else echo nothing to do ; fi"
|
||||||
|
# - "git commit -am \"chore: auto update version [skip ci]\""
|
||||||
- "git push origin HEAD:dev"
|
- "git push origin HEAD:dev"
|
||||||
secrets: [git_pat]
|
secrets: [git_pat]
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,10 @@
|
||||||
|
|
||||||
read -r msg
|
read -r msg
|
||||||
|
|
||||||
|
echo "read the following commit message: $msg"
|
||||||
|
|
||||||
if [[ $msg = *"BREAKING CHANGE:"* ]]; then
|
if [[ $msg = *"BREAKING CHANGE:"* ]]; then
|
||||||
|
echo "detected breaking change, updating major version"
|
||||||
./update-version.sh MAJOR
|
./update-version.sh MAJOR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -10,10 +13,12 @@ summary=$(echo "$msg" | head -1)
|
||||||
type=$(cut -d':' -f1 <<< "$summary")
|
type=$(cut -d':' -f1 <<< "$summary")
|
||||||
|
|
||||||
if [[ $type = *"!"* ]]; then
|
if [[ $type = *"!"* ]]; then
|
||||||
|
echo "detected breaking change, updating major version"
|
||||||
./version-update.sh MAJOR
|
./version-update.sh MAJOR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $type = "feat" ]]; then
|
if [[ $type = "feat" ]]; then
|
||||||
|
echo "detected feature, updating minor version"
|
||||||
./version-update.sh MINOR
|
./version-update.sh MINOR
|
||||||
else
|
else
|
||||||
echo "last commit message does not indicate a base version update, skipping"
|
echo "last commit message does not indicate a base version update, skipping"
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
1.0
|
0.2
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue