File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 3737 - name : Push changes
3838 run : |
3939 git push --follow-tags
40+ - name : " Install Poetry"
41+ run : pip install poetry
42+ - name : " Determine version bump type"
43+ run : |
44+ git fetch --tags
45+ # This defaults to a patch type, unless a feature commit was pushed, then set type to minor
46+ LAST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
47+ LAST_COMMIT=$(git log -1 --format='%H')
48+ echo "Last git tag: $LAST_TAG"
49+ echo "Last git commit: $LAST_COMMIT"
50+ echo "Commits:"
51+ git log --no-merges --pretty=oneline $LAST_TAG...$LAST_COMMIT
52+ git log --no-merges --pretty=format:"%s" $LAST_TAG...$LAST_COMMIT | grep -q ^feat: && BUMP_TYPE="minor" || BUMP_TYPE="patch"
53+ echo "Version bump type: $BUMP_TYPE"
54+ echo "BUMP_TYPE=$BUMP_TYPE" >> $GITHUB_ENV
55+ env :
56+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57+ - name : " Version bump"
58+ run : |
59+ poetry version $BUMP_TYPE
60+ - name : " Push new version"
61+ run : |
62+ git add pyproject.toml
63+ git commit -m "Update version to $(poetry version -s)"
64+ git push origin HEAD:${{ github.event.pull_request.head.ref }}
65+ env :
66+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments