@@ -8,12 +8,14 @@ branding:
88
99inputs :
1010 version :
11- description : " cargo-rail version to install (default: 0.12.0; use 'latest' for floating installs)"
11+ description : " cargo-rail version to install (default: 0.13.0; use 'latest' for
12+ floating installs)"
1213 required : false
13- default : " 0.12 .0"
14+ default : " 0.13 .0"
1415
1516 checksum :
16- description : " Checksum verification mode for downloaded binaries: required/if-available/off"
17+ description : " Checksum verification mode for downloaded binaries:
18+ required/if-available/off"
1719 required : false
1820 default : " required"
1921
@@ -151,7 +153,7 @@ runs:
151153 shasum -a 256 "$file" | awk '{print $1}'
152154
153155 else
154-
156+
155157 if command -v python3 &>/dev/null; then
156158 python3 -c 'import hashlib,sys; p=sys.argv[1]; h=hashlib.sha256(); f=open(p,"rb"); [h.update(b) for b in iter(lambda: f.read(1024*1024), b"")]; f.close(); print(h.hexdigest())' "$file"
157159 elif command -v python &>/dev/null; then
@@ -167,7 +169,7 @@ runs:
167169 local archive_path="$1"
168170 local archive_name="$2"
169171 local mode="${CHECKSUM_MODE:-required}"
170-
172+
171173 case "$mode" in
172174 off)
173175 echo "Checksum verification disabled (checksum=off)"
@@ -180,10 +182,10 @@ runs:
180182 exit 1
181183 ;;
182184 esac
183-
185+
184186 local sums_url="https://github.com/loadingalias/cargo-rail/releases/download/v${VERSION}/SHA256SUMS"
185187 local sums_path="/tmp/SHA256SUMS-cargo-rail"
186-
188+
187189 if ! curl -fsSL --retry 3 "$sums_url" -o "$sums_path" 2>/dev/null; then
188190 if [[ "$mode" == "required" ]]; then
189191 echo "::error::SHA256SUMS not found for v$VERSION; set checksum: if-available or off to skip verification"
@@ -192,21 +194,21 @@ runs:
192194 echo "::warning::SHA256SUMS not found for v$VERSION; skipping checksum verification"
193195 return 0
194196 fi
195-
197+
196198 local expected
197199 expected="$(awk -v f="$archive_name" '$2==f || $2=="*"f {print $1; exit}' "$sums_path" 2>/dev/null || true)"
198200 if [[ -z "$expected" ]]; then
199201 echo "::error::SHA256SUMS is present for v$VERSION but has no entry for $archive_name"
200202 exit 1
201203 fi
202-
204+
203205 local actual
204206 actual="$(calc_sha256 "$archive_path")"
205207 if [[ "$actual" != "$expected" ]]; then
206208 echo "::error::Checksum mismatch for $archive_name (expected $expected, got $actual)"
207209 exit 1
208210 fi
209-
211+
210212 echo "Checksum verified for $archive_name"
211213 }
212214
0 commit comments