Skip to content

Commit

Permalink
ci(): adding github action files
Browse files Browse the repository at this point in the history
  • Loading branch information
jossef committed Feb 11, 2021
1 parent ef9102e commit 50f45f1
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
21 changes: 21 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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'
18 changes: 18 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 50f45f1

Please sign in to comment.