1313
1414yaml = ruamel .yaml .YAML (typ = "safe" )
1515
16+ # Please provide the output of `grype koalaman/shellcheck@sha256:<newhash>`
17+ # in your PR when bumping. Referenced by SHA for safety.
18+ DefaultShellCheckImage = "koalaman/shellcheck@sha256:652a5a714dc2f5f97e36f565d4f7d2322fea376734f3ec1b04ed54ce2a0b124f"
19+
1620
1721def do_shellcheck (
1822 melange_cfg : Mapping [str , Any ],
@@ -55,7 +59,7 @@ def do_shellcheck(
5559 shfile .write (step ["runs" ])
5660 shfile .close ()
5761 subprocess .check_call (
58- [ "/usr/bin/ shellcheck" ]
62+ shellcheck
5963 + shellcheck_args
6064 + ["--shell=busybox" , "--" ]
6165 + [os .path .basename (f .name ) for _ , f in all_steps ],
@@ -68,8 +72,7 @@ def main(argv: Sequence[str] | None = None) -> int:
6872 parser .add_argument (
6973 "filenames" ,
7074 nargs = "*" ,
71- help = "Filenames to check. You can also pass "
72- "arguments to shellcheck before a '--' separator." ,
75+ metavar = "[-- SHELLCHECK ARGS -- ] FILENAMES" ,
7376 )
7477 parser .add_argument (
7578 "--shellcheck" ,
@@ -79,7 +82,7 @@ def main(argv: Sequence[str] | None = None) -> int:
7982 f"--volume={ os .getcwd ()} :/mnt" ,
8083 "--rm" ,
8184 "-it" ,
82- "koalaman/shellcheck:latest" ,
85+ DefaultShellCheckImage ,
8386 ],
8487 nargs = "*" ,
8588 help = "shellcheck command" ,
0 commit comments