Skip to content

Commit

Permalink
Expand the arguments to a list of strings when they are provided as a…
Browse files Browse the repository at this point in the history
… single string

The GitHub action provide the arguments as a single string to the docker container,
so we need to expand them in order for gosec to properly interpret them.

Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
  • Loading branch information
ccojocar authored and Cosmin Cojocar committed Jul 6, 2020
1 parent 59cbe00 commit 37d1af0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ RUN go mod download
RUN make build-linux

FROM golang:${GO_VERSION}-alpine
RUN apk add --update --no-cache ca-certificates git gcc libc-dev
RUN apk add --update --no-cache ca-certificates bash git gcc libc-dev
ENV GO111MODULE on
COPY --from=builder /build/gosec /bin/gosec
ENTRYPOINT ["/bin/gosec"]
COPY entrypoint.sh /bin/entrypoint.sh
ENTRYPOINT ["/bin/entrypoint.sh"]
7 changes: 7 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

# Expand the arguments into an array of strings. This is requires because the GitHub action
# provides all arguments concatenated as a single string.
ARGS=("$@")

/bin/gosec ${ARGS[*]}

0 comments on commit 37d1af0

Please sign in to comment.