File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 67
67
images : ${{ inputs.image }}
68
68
tags : |
69
69
type=raw,value=latest
70
- type=sha,format=short ,prefix=
70
+ type=sha,format=long ,prefix=
71
71
${{ inputs.tag_with_version && format('type=raw,value=v{0}', inputs.version) || '' }}
72
72
73
73
- name : Build and Push Image
85
85
run : |
86
86
IMAGE="${{ inputs.image }}"
87
87
NAME="${IMAGE##*/}"
88
- SHORT_SHA="${GITHUB_SHA::7}"
89
- TAGS="latest, ${SHORT_SHA}"
88
+ # Derive SHA from the checked-out ref to ensure correctness.
89
+ FULL_SHA=$(git rev-parse HEAD)
90
+ TAGS="latest, ${FULL_SHA}"
90
91
if [ "${{ inputs.tag_with_version }}" = "true" ] && [ -n "${{ inputs.version }}" ]; then
91
92
TAGS="${TAGS}, v${{ inputs.version }}"
92
93
fi
Original file line number Diff line number Diff line change 15
15
- minor
16
16
- major
17
17
default : patch
18
+ release :
19
+ description : " Manual release version (e.g. 1.2.3). Overrides bump."
20
+ type : string
21
+ required : false
22
+ default : " "
18
23
19
24
permissions :
20
25
contents : write
38
43
- name : Install cargo-edit
39
44
run : cargo install cargo-edit --locked
40
45
41
- - name : Bump Workspace Versions
46
+ - name : Set Workspace Version (manual or bump)
47
+ shell : bash
42
48
run : |
43
- cargo set-version --workspace --bump "${{ inputs.bump }}"
49
+ set -euo pipefail
50
+ MANUAL_RELEASE="${{ inputs.release }}"
51
+ if [[ -n "${MANUAL_RELEASE}" ]]; then
52
+ # Validate SemVer (strict X.Y.Z numeric to align with repo conventions).
53
+ if [[ ! "${MANUAL_RELEASE}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
54
+ echo "Provided release '${MANUAL_RELEASE}' is not a valid SemVer (expected X.Y.Z)." >&2
55
+ exit 1
56
+ fi
57
+ echo "Setting workspace version to ${MANUAL_RELEASE} (manual)."
58
+ cargo set-version --workspace "${MANUAL_RELEASE}"
59
+ else
60
+ echo "Bumping workspace version by '${{ inputs.bump }}'."
61
+ cargo set-version --workspace --bump "${{ inputs.bump }}"
62
+ fi
44
63
45
64
- name : Read New Version
46
65
id : ver
You can’t perform that action at this time.
0 commit comments