forked from oracle/docker-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlint
executable file
·30 lines (26 loc) · 873 Bytes
/
lint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash -e
# Copyright (c) 2022, 2023, Oracle and/or its affiliates.
#
REPO_DIR="$(git rev-parse --show-toplevel)/"
CURR_DIR="$PWD/"
if [ "$REPO_DIR" != "$CURR_DIR" ]; then
FILTER_REGEX_INCLUDE="./${PWD/$REPO_DIR/}/.*"
fi
# Find a container runtime
checkContainerRuntime() {
CONTAINER_RUNTIME=$(which docker 2>/dev/null) ||
CONTAINER_RUNTIME=$(which podman 2>/dev/null) ||
{
echo "Error: no supported container runtime found."
exit 1
}
}
# Check that we have a container runtime installed
checkContainerRuntime
# Run the Super Linter container
$CONTAINER_RUNTIME run --name super-linter --rm \
-e RUN_LOCAL=true --platform linux/amd64 \
-e FILTER_REGEX_INCLUDE="$FILTER_REGEX_INCLUDE" \
--env-file "$REPO_DIR/.github/super-linter.env" \
"${PROXY_SETTINGS[@]}" \
-v "$REPO_DIR:/tmp/lint" ghcr.io/github/super-linter:slim-latest