diff --git a/Dockerfile b/Dockerfile index e69de29..554c9b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM golang:1.13 +WORKDIR /src +COPY . . +ENV GO111MODULE=on +RUN go build -o /bin/dusti-lock +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..61813b7 --- /dev/null +++ b/action.yml @@ -0,0 +1,21 @@ +name: 'DustiLock' +description: 'Scanning project dependencies - checks if one or more is available for public registration' +inputs: + recursive: + description: 'scan recursively (default = false)' + required: false + default: '' + path: + description: 'custom scan dir (e.g. "subdir1/subdir2")' + required: false + default: '' + audit: + description: 'disable failing the build when having alerts (default = false)' + required: false + default: '' +runs: + using: 'docker' + image: 'Dockerfile' +branding: + icon: 'edit' + color: 'yellow' diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..1400e96 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/sh -l + +export SCAN_PATH="/github/workspace/" +export ARGS="" + +if [ -n "$INPUT_RECURSIVE" ]; then + export ARGS="$ARGS -r" +fi + +if [ -n "$INPUT_AUDIT" ]; then + export ARGS="$ARGS -a" +fi + +if [ -n "$INPUT_PATH" ]; then + export SCAN_PATH="$SCAN_PATH$INPUT_PATH" +fi + +/bin/dusti-lock -p $SCAN_PATH$ARGS \ No newline at end of file