Skip to content

Commit

Permalink
fix: Build problem ⚓
Browse files Browse the repository at this point in the history
  • Loading branch information
gabyx committed Jan 23, 2024
1 parent b67a889 commit 6256576
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 11 deletions.
3 changes: 3 additions & 0 deletions tests/exec-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ RUN git config --global githooks.deleteDetectedLFSHooks "n"
${ADDITIONAL_INSTALL_STEPS:-}
# Git-Core folder must be existing.
RUN [ -d "\$GH_TEST_GIT_CORE/templates/hooks" ]
RUN echo "Git version: \$(git --version)"
WORKDIR \$GH_TESTS
EOF
Expand Down
2 changes: 1 addition & 1 deletion tests/test-alpine-nolfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST_DIR=$(cd "$(dirname "$0")" && pwd)

cat <<EOF | docker build --force-rm -t githooks:alpine-nolfs-base -
FROM golang:1.20-alpine
RUN apk add git --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --allow-untrusted
RUN apk update && apk add git
RUN apk add bash jq curl docker
# CVE https://github.blog/2022-10-18-git-security-vulnerabilities-announced/#cve-2022-39253
Expand Down
7 changes: 5 additions & 2 deletions tests/test-alpine-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ TEST_DIR=$(cd "$(dirname "$0")" && pwd)
cat <<EOF | docker build \
--force-rm -t githooks:alpine-user-base -
FROM golang:1.20-alpine
RUN apk add git git-lfs --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --allow-untrusted
RUN apk update && apk add git git-lfs
RUN apk add bash jq curl
# CVE https://github.blog/2022-10-18-git-security-vulnerabilities-announced/#cve-2022-39253
RUN git config --system protocol.file.allow always
# Must be existing.
RUN [ -d "$GH_TEST_GIT_CORE/templates/hooks" ]
EOF

# shellcheck disable=SC2016,SC1004
Expand All @@ -25,7 +28,7 @@ RUN if [ -n "$DOCKER_GROUP_ID" ]; then \
else \
echo "Not adding docker since not working with user!" &>2; \
fi
RUN [ -d "$GH_TEST_GIT_CORE/templates/hooks" ] && \
RUN [ ! -d "$GH_TEST_GIT_CORE/templates/hooks" ] || \
rm -rf "$GH_TEST_GIT_CORE/templates/hooks"
RUN mkdir -p "$GH_TEST_REPO" "$GH_TEST_GIT_CORE/templates/hooks" && \
chown -R test:test "$GH_TEST_REPO" "$GH_TEST_GIT_CORE"
Expand Down
2 changes: 1 addition & 1 deletion tests/test-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST_DIR=$(cd "$(dirname "$0")" && pwd)

cat <<EOF | docker build --force-rm -t githooks:alpine-lfs-base -
FROM golang:1.20-alpine
RUN apk add git git-lfs --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --allow-untrusted
RUN apk update && apk add git git-lfs
RUN apk add bash jq curl docker
# CVE https://github.blog/2022-10-18-git-security-vulnerabilities-announced/#cve-2022-39253
Expand Down
2 changes: 1 addition & 1 deletion tests/test-corehookspath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST_DIR=$(cd "$(dirname "$0")" && pwd)

cat <<EOF | docker build --force-rm -t githooks:alpine-lfs-corehookspath-base -
FROM golang:1.20-alpine
RUN apk add git git-lfs --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --allow-untrusted
RUN apk update && apk add git git-lfs
RUN apk add bash jq curl docker
# CVE https://github.blog/2022-10-18-git-security-vulnerabilities-announced/#cve-2022-39253
Expand Down
2 changes: 1 addition & 1 deletion tests/test-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trap cleanup EXIT

cat <<EOF | docker build --force-rm -t githooks:$IMAGE_TYPE-base -
FROM golang:1.20-alpine
RUN apk add git git-lfs --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --allow-untrusted
RUN apk update && apk add git git-lfs
RUN apk add bash jq curl docker
# CVE https://github.blog/2022-10-18-git-security-vulnerabilities-announced/#cve-2022-39253
Expand Down
4 changes: 2 additions & 2 deletions tests/test-rules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ rootDir=$(git rev-parse --show-toplevel)

cat <<EOF | docker build --force-rm -t githooks:test-rules -
FROM golang:1.20-alpine
RUN apk add git curl git-lfs --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --allow-untrusted
RUN apk add bash jq docker
RUN apk update && apk add git git-lfs
RUN apk add bash jq curl docker
RUN git config --global safe.directory /data
Expand Down
4 changes: 2 additions & 2 deletions tests/test-testsuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ trap cleanUp EXIT

cat <<EOF | docker build --force-rm -t githooks:testsuite -
FROM golang:1.20-alpine
RUN apk add git curl git-lfs --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --allow-untrusted
RUN apk add bash jq docker
RUN apk update && apk add git git-lfs
RUN apk add bash jq curl docker
# CVE https://github.blog/2022-10-18-git-security-vulnerabilities-announced/#cve-2022-39253
RUN git config --system protocol.file.allow always
Expand Down
2 changes: 1 addition & 1 deletion tests/test-whitespace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST_DIR=$(cd "$(dirname "$0")" && pwd)

cat <<EOF | docker build --force-rm -t githooks:alpine-lfs-whitespace-base -
FROM golang:1.20-alpine
RUN apk add git git-lfs --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --allow-untrusted
RUN apk update && apk add git git-lfs
RUN apk add bash jq curl docker
# CVE https://github.blog/2022-10-18-git-security-vulnerabilities-announced/#cve-2022-39253
Expand Down

0 comments on commit 6256576

Please sign in to comment.