diff --git a/.woodpecker/.lint_general.yml b/.woodpecker/.lint_general.yml index d27e880..d76db3f 100644 --- a/.woodpecker/.lint_general.yml +++ b/.woodpecker/.lint_general.yml @@ -23,7 +23,8 @@ steps: image: node:lts-slim commands: - 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: - branch: [main, dev] event: push diff --git a/.woodpecker/.version-update.yml b/.woodpecker/.version-update.yml index 04b4d38..cc5f113 100644 --- a/.woodpecker/.version-update.yml +++ b/.woodpecker/.version-update.yml @@ -17,7 +17,8 @@ steps: - 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.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" secrets: [git_pat] depends_on: diff --git a/version-auto-update.sh b/version-auto-update.sh index 0243cc6..197fd5c 100755 --- a/version-auto-update.sh +++ b/version-auto-update.sh @@ -2,7 +2,10 @@ read -r msg +echo "read the following commit message: $msg" + if [[ $msg = *"BREAKING CHANGE:"* ]]; then + echo "detected breaking change, updating major version" ./update-version.sh MAJOR fi @@ -10,10 +13,12 @@ summary=$(echo "$msg" | head -1) type=$(cut -d':' -f1 <<< "$summary") if [[ $type = *"!"* ]]; then + echo "detected breaking change, updating major version" ./version-update.sh MAJOR fi if [[ $type = "feat" ]]; then + echo "detected feature, updating minor version" ./version-update.sh MINOR else echo "last commit message does not indicate a base version update, skipping" diff --git a/version.txt b/version.txt index d3827e7..3b04cfb 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0 +0.2