1
0
mirror of https://github.com/go-task/task.git synced 2025-11-27 22:38:20 +02:00

feat: checksum pinning (#2223)

This commit is contained in:
Pete Davison
2025-05-24 14:00:02 +01:00
committed by GitHub
parent 68ce8b1d84
commit 71eb8cdeea
17 changed files with 196 additions and 15 deletions

View File

@@ -187,3 +187,24 @@ func (err TaskfileCycleError) Error() string {
func (err TaskfileCycleError) Code() int {
return CodeTaskfileCycle
}
// TaskfileDoesNotMatchChecksum is returned when a Taskfile's checksum does not
// match the one pinned in the parent Taskfile.
type TaskfileDoesNotMatchChecksum struct {
URI string
ExpectedChecksum string
ActualChecksum string
}
func (err *TaskfileDoesNotMatchChecksum) Error() string {
return fmt.Sprintf(
"task: The checksum of the Taskfile at %q does not match!\ngot: %q\nwant: %q",
err.URI,
err.ActualChecksum,
err.ExpectedChecksum,
)
}
func (err *TaskfileDoesNotMatchChecksum) Code() int {
return CodeTaskfileDoesNotMatchChecksum
}