From 59e36576596d7e16133f7cbc9fda13e061b9ba4f Mon Sep 17 00:00:00 2001 From: root Date: Fri, 7 Mar 2025 15:45:12 +0000 Subject: [PATCH 1/3] add set up go --- .github/workflows/go-common.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/go-common.yml b/.github/workflows/go-common.yml index 71f0b21c..e2e4fbae 100644 --- a/.github/workflows/go-common.yml +++ b/.github/workflows/go-common.yml @@ -91,6 +91,11 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "1.24" + - name: gosec uses: dell/common-github-actions/gosec-runner@main with: From b45aa0e7774c13009c07ba930534204953df2570 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 7 Mar 2025 16:06:34 +0000 Subject: [PATCH 2/3] use latest gosec --- .github/workflows/go-common.yml | 7 +------ gosec-runner/entrypoint.sh | 5 ++++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go-common.yml b/.github/workflows/go-common.yml index e2e4fbae..43606d05 100644 --- a/.github/workflows/go-common.yml +++ b/.github/workflows/go-common.yml @@ -91,13 +91,8 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: "1.24" - - name: gosec - uses: dell/common-github-actions/gosec-runner@main + uses: dell/common-github-actions/gosec-runner@add-setup-go with: excludes: ${{ env.GOSEC_EXCLUDES }} exclude-dir: ${{ env.GOSEC_EXCLUDE_DIR }} diff --git a/gosec-runner/entrypoint.sh b/gosec-runner/entrypoint.sh index f33a7153..45885dca 100755 --- a/gosec-runner/entrypoint.sh +++ b/gosec-runner/entrypoint.sh @@ -22,7 +22,10 @@ then EXCLUDE_DIR_FLAG="-exclude-dir=$EXCLUDE_DIR" fi -curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.21.4 +# Fetch the latest version of gosec +LATEST_VERSION=$(curl -s https://api.github.com/repos/securego/gosec/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + +curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $LATEST_VERSION echo "run gosec command: $(go env GOPATH)/bin/gosec $EXCLUDE_FLAG $EXCLUDE_DIR_FLAG $DIRECTORIES" $(go env GOPATH)/bin/gosec $EXCLUDE_FLAG $EXCLUDE_DIR_FLAG $DIRECTORIES From 54477c6b2b2c1adb63d2a2dd32810e0e2f0db985 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 7 Mar 2025 16:14:02 +0000 Subject: [PATCH 3/3] revert back to main branch --- .github/workflows/go-common.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-common.yml b/.github/workflows/go-common.yml index 43606d05..71f0b21c 100644 --- a/.github/workflows/go-common.yml +++ b/.github/workflows/go-common.yml @@ -92,7 +92,7 @@ jobs: uses: actions/checkout@v4 - name: gosec - uses: dell/common-github-actions/gosec-runner@add-setup-go + uses: dell/common-github-actions/gosec-runner@main with: excludes: ${{ env.GOSEC_EXCLUDES }} exclude-dir: ${{ env.GOSEC_EXCLUDE_DIR }}