Skip to content

Commit fe4e419

Browse files
committed
feat: add superlinter bin
1 parent ccc857e commit fe4e419

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

bin/superlinter

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Running GitHub Super-Linter Locally
4+
# https://github.com/github/super-linter/blob/main/docs/run-linter-locally.md
5+
6+
export SUPERLINTER_IMAGE="${SUPERLINTER_IMAGE:-"github/super-linter"}"
7+
export SUPERLINTER_VERSION="${SUPERLINTER_VERSION:-"slim-latest"}"
8+
9+
main() {
10+
if [ "$(whoami)" == "runner" ]; then
11+
: # echo "Don't execute in GitHub Actions workflow runs."
12+
else
13+
local OPTS=()
14+
OPTS+=(--rm)
15+
[[ -z "$PS1" ]] && OPTS+=(-it)
16+
OPTS+=(-e RUN_LOCAL=true)
17+
OPTS+=(-v "$(pwd):/tmp/lint")
18+
[[ -e "$(pwd)/.github/super-linter.env" ]] &&
19+
OPTS+=(--env-file "$(pwd)/.github/super-linter.env")
20+
docker run "${OPTS[@]}" "${SUPERLINTER_IMAGE}:${SUPERLINTER_VERSION}" "$@"
21+
fi
22+
}
23+
24+
main "$@"

0 commit comments

Comments
 (0)