Skip to content

Commit bde5ddb

Browse files
authored
Add gosec dependency installation (#172)
1 parent 20335b9 commit bde5ddb

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

.github/workflows/go-common.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
- name: Checkout code
9595
uses: actions/checkout@v4
9696

97-
- name: gosec
97+
- name: Run Gosec
9898
uses: dell/common-github-actions/gosec-runner@main
9999
with:
100100
excludes: ${{ env.GOSEC_EXCLUDES }}

gosec-runner/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LABEL "com.github.actions.color"="gray-dark"
77

88
LABEL version="1.0.0"
99

10+
RUN go install github.com/securego/gosec/v2/cmd/gosec@latest
11+
1012
ENV GOFLAGS="-buildvcs=false"
1113
COPY entrypoint.sh /entrypoint.sh
1214
RUN chmod +x /entrypoint.sh

gosec-runner/entrypoint.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ get_exclude_directories() {
3939
EXCLUDE_DIR_FLAG="$exclude_arg"
4040
}
4141

42-
# Fetch the latest version of gosec
43-
LATEST_VERSION=$(curl -s https://api.github.com/repos/securego/gosec/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
44-
45-
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $LATEST_VERSION
46-
4742
submodules=$(find . -name 'go.mod' -exec dirname {} +)
4843
for submodule in $submodules; do
4944
echo "Running gosec on $submodule"

0 commit comments

Comments
 (0)