Skip to content

Commit 7618508

Browse files
ci: bump ghasum from v0.6.1 to v0.6.3 (#1468)
1 parent 6f63b9b commit 7618508

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

.github/actions/ghasum/action.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ inputs:
88
checksum:
99
description: The checksum of the ghasum checksums file
1010
required: false
11-
default: 4c3610665f3e9ccd84f8529810f40ac9ef2cc0ca3508e3a1bc51dda8d1f8624f836f3fc776ce68bc4bbbb0a6b0b4e7f2bf841f84eb695cc0ded1285c242d801b # Set the 'checksums-sha512.txt' file's checksum.
11+
default: sha256:ea8d55ff6d1a0a733a499f52594e25841038e65de1f45986cb0eea3ecd011c34
1212
version:
1313
description: The version of ghasum to use
1414
required: false
15-
default: v0.6.1 # Set the ghasum version.
15+
default: v0.6.3 # Set the ghasum version.
1616

1717
runs:
1818
using: composite
@@ -33,7 +33,7 @@ runs:
3333
run: |
3434
ARTIFACT='checksums-sha512.txt'
3535
gh release download "$VERSION" --repo chains-project/ghasum --pattern "$ARTIFACT"
36-
echo "$CHECKSUM $ARTIFACT" | shasum -a 256 -c -
36+
echo "${CHECKSUM#sha256:} $ARTIFACT" | shasum -a 256 -c -
3737
3838
# Windows download
3939
- name: Initialize ghasum directory
@@ -51,7 +51,7 @@ runs:
5151
run: |
5252
$ARTIFACT = "checksums-sha512.txt"
5353
gh release download "$env:VERSION" --repo chains-project/ghasum --pattern "$ARTIFACT"
54-
if ((Get-FileHash -Algorithm SHA256 "$ARTIFACT").Hash -ne "$env:CHECKSUM") {
54+
if ((Get-FileHash -Algorithm SHA256 "$ARTIFACT").Hash -ne ($env:CHECKSUM -replace '^sha256:', '')) {
5555
Write-Error 'Checksum mismatch!'
5656
exit 1
5757
} else {
@@ -197,6 +197,25 @@ runs:
197197
run: |
198198
C:\ghasum\ghasum.exe update -force
199199
200+
# Invalidate actions
201+
- name: Remove actions
202+
if: failure() && runner.os == 'Linux'
203+
shell: bash
204+
run: rm -rf /home/runner/work/_actions
205+
- name: Remove actions
206+
if: failure() && runner.os == 'macOS'
207+
shell: bash
208+
run: rm -rf /Users/runner/work/_actions
209+
- name: Remove actions
210+
if: failure() && runner.os == 'Windows'
211+
shell: pwsh
212+
run: |
213+
if (Test-Path -Path 'C:\a\_actions') {
214+
Remove-Item -Recurse -Force -Path C:\a\_actions
215+
} else {
216+
Remove-Item -Recurse -Force -Path D:\a\_actions
217+
}
218+
200219
# Cleanup
201220
- name: Cleanup (Unix)
202221
if: runner.os == 'macOS' || runner.os == 'Linux'

0 commit comments

Comments
 (0)