File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,17 @@ jobs:
1818 id : version
1919 shell : bash
2020 run : |
21- today="$(date --utc '+%Y-%m-%d')"
22- midnight_timestamp="$(date --utc +%s --date=$today)"
23- calver_date="$(date --utc --date=$today '+%Y.%-m.dev%d')"
24- commit_count="$(git rev-list --count --since=$midnight_timestamp HEAD)"
25- commit_count="$(printf "%02d" ${commit_count})"
26- version="${calver_date}${commit_count}"
21+ version=$(echo "${{ github.ref }}" | awk -F"/" '{print $NF}')
22+ if [[ ! -z "${{ github.event.inputs.version }}" ]]; then
23+ version="${{ github.event.inputs.version }}"
24+ elif [[ "${version}" =~ (main|dev) ]]; then
25+ today="$(date --utc '+%Y-%m-%d')"
26+ midnight_timestamp="$(date --utc +%s --date=$today)"
27+ calver_date="$(date --utc --date=$today '+%Y.%-m.dev%d')"
28+ commit_count="$(git rev-list --count --since=$midnight_timestamp HEAD)"
29+ commit_count="$(printf "%02d" ${commit_count})"
30+ version="${calver_date}${commit_count}"
31+ fi
2732 echo "version=$version" >> "$GITHUB_OUTPUT"
2833 - name : Find-and-replace strings
2934 id : python-version
You can’t perform that action at this time.
0 commit comments