Skip to content

Commit 37d1af0

Browse files
ccojocarCosmin Cojocar
authored andcommitted
Expand the arguments to a list of strings when they are provided as a 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>
1 parent 59cbe00 commit 37d1af0

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ RUN go mod download
88
RUN make build-linux
99

1010
FROM golang:${GO_VERSION}-alpine
11-
RUN apk add --update --no-cache ca-certificates git gcc libc-dev
11+
RUN apk add --update --no-cache ca-certificates bash git gcc libc-dev
1212
ENV GO111MODULE on
1313
COPY --from=builder /build/gosec /bin/gosec
14-
ENTRYPOINT ["/bin/gosec"]
14+
COPY entrypoint.sh /bin/entrypoint.sh
15+
ENTRYPOINT ["/bin/entrypoint.sh"]

entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
# Expand the arguments into an array of strings. This is requires because the GitHub action
4+
# provides all arguments concatenated as a single string.
5+
ARGS=("$@")
6+
7+
/bin/gosec ${ARGS[*]}

0 commit comments

Comments
 (0)