File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1212 workflow_dispatch :
1313 inputs :
1414 version :
15- description : ' Version tag (e.g., 1.0.0). Leave empty for "latest "'
15+ description : ' Version tag (e.g., 1.0.0). Leave empty for "dev-{sha} "'
1616 required : false
1717 default : ' '
1818
@@ -31,12 +31,16 @@ jobs:
3131 id : version
3232 run : |
3333 if [ -n "${{ github.event.inputs.version }}" ]; then
34+ # Manual input: use as-is
3435 VERSION="${{ github.event.inputs.version }}"
3536 elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then
37+ # Version tag: strip 'v' prefix
3638 VERSION="${{ github.ref_name }}"
3739 VERSION="${VERSION#v}"
3840 else
39- VERSION="latest"
41+ # Branch push (main): use dev-{short_sha}
42+ SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
43+ VERSION="dev-${SHORT_SHA}"
4044 fi
4145 echo "version=$VERSION" >> $GITHUB_OUTPUT
4246 echo "Version: $VERSION"
You can’t perform that action at this time.
0 commit comments