Skip to content

Commit fc079ee

Browse files
Build full package in Dockerfile to include all commands (#1844)
* Pin go-licenses to v2.0.1 for reproducible builds Fixes code scanning alerts #10 and #11 by removing the @latest version for local development and using the pinned v2.0.1 version consistently across all environments. This ensures deterministic builds and addresses the CWE-494 'Download of Code Without Integrity Check' security concern. * Build full package in Dockerfile to include all commands
1 parent e81f120 commit fc079ee

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \
1414
--mount=type=cache,target=/root/.cache/go-build \
1515
--mount=type=bind,target=. \
1616
CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=${VERSION} -X main.commit=$(git rev-parse HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
17-
-o /bin/github-mcp-server cmd/github-mcp-server/main.go
17+
-o /bin/github-mcp-server ./cmd/github-mcp-server
1818

1919
# Make a stage to run the app
2020
FROM gcr.io/distroless/base-debian12

script/licenses

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@
1818
# depending on the license.
1919
set -e
2020

21-
# Pinned version for CI reproducibility, latest for local development
21+
# Pinned version for reproducibility
2222
# See: https://github.com/cli/cli/pull/11161
23-
if [ "$CI" = "true" ]; then
24-
go install github.com/google/go-licenses@5348b744d0983d85713295ea08a20cca1654a45e # v2.0.1
25-
else
26-
go install github.com/google/go-licenses@latest
27-
fi
23+
go install github.com/google/go-licenses/v2@v2.0.1
2824

2925
# actions/setup-go does not setup the installed toolchain to be preferred over the system install,
3026
# which causes go-licenses to raise "Package ... does not have module info" errors in CI.

0 commit comments

Comments
 (0)