bake: correctly match error when parsing definition by crazy-max · Pull Request #225 · docker/actions-toolkit (original) (raw)

related to https://github.com/docker/bake-action/actions/runs/7274951418/job/19821919843#step:6:120

Currently when parsing definitions fails it would return an error but not on the correct line:

image

Error: #1 [internal] load local bake definitions
#1 reading ./test/config.hcl 623B / 623B done
#1 reading . 0B / 4.10kB done
#1 DONE 0.0s
ERROR: read .: is a directory

This change ensures we return the right line (here read .: is a directory) like we do in bake-action and build-push-action: https://github.com/docker/bake-action/blob/52a1696536aaa8818afd3753a71ec46298b8a19b/src/main.ts#L89