Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ inputs:
version:
required: false
description: The version of mise to use. If not specified, will use the latest release.
sha256:
required: false
description: The SHA256 checksum of the mise binary to verify the download.
mise_dir:
required: false
description: |
Expand Down
10 changes: 10 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,19 @@ async function setupMise(version: string): Promise<void> {
break
}
}
// compare with provided hash
const want = core.getInput('sha256')
if (want) {
const hash = crypto.createHash('sha256')
const fileBuffer = await fs.promises.readFile(miseBinPath)
const got = hash.update(fileBuffer).digest('hex')
if (got !== want) {
throw new Error(
`SHA256 mismatch: expected ${want}, got ${got} for ${miseBinPath}`
)
}
}

core.addPath(miseBinDir)
}

Expand Down
Loading