File tree Expand file tree Collapse file tree 1 file changed +1
-27
lines changed Expand file tree Collapse file tree 1 file changed +1
-27
lines changed Original file line number Diff line number Diff line change 1616 - name : Checkout repository
1717 uses : actions/checkout@v4
1818 with :
19- fetch-depth : 0 # Required for semantic-release to access full git history
19+ fetch-depth : 0
2020
2121 - name : Set up Python
2222 uses : actions/setup-python@v5
4747 run : |
4848 git pull --ff-only origin main
4949 git push origin main --follow-tags
50-
51- - name : " Determine version bump type"
52- run : |
53- git fetch --tags
54- # This defaults to a patch type, unless a feature commit was pushed, then set type to minor
55- LAST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
56- LAST_COMMIT=$(git log -1 --format='%H')
57- echo "Last git tag: $LAST_TAG"
58- echo "Last git commit: $LAST_COMMIT"
59- echo "Commits:"
60- git log --no-merges --pretty=oneline $LAST_TAG...$LAST_COMMIT
61- git log --no-merges --pretty=format:"%s" $LAST_TAG...$LAST_COMMIT | grep -q ^feat: && BUMP_TYPE="minor" || BUMP_TYPE="patch"
62- echo "Version bump type: $BUMP_TYPE"
63- echo "BUMP_TYPE=$BUMP_TYPE" >> $GITHUB_ENV
64- env :
65- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66- - name : " Version bump"
67- run : |
68- poetry version $BUMP_TYPE
69- - name : " Push new version"
70- run : |
71- git add pyproject.toml
72- git commit -m "Update version to $(poetry version -s)"
73- git push origin HEAD:${{ github.event.pull_request.head.ref }}
74- env :
75- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments