diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index cf9ef60..a2bc117 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -35,11 +35,6 @@ jobs: with: go-version-file: go.mod - - name: Configure git for private modules - run: ./hack/setup-git-redirect.sh - env: - GITHUB_PAT: ${{ secrets.BOT_PAT }} - - name: Lint golang sources uses: golangci/golangci-lint-action@v4 with: @@ -58,11 +53,6 @@ jobs: with: go-version-file: go.mod - - name: Configure git for private modules - run: ./hack/setup-git-redirect.sh - env: - GITHUB_PAT: ${{ secrets.BOT_PAT }} - - name: Run tests run: make test @@ -141,7 +131,5 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - build-args: | - GOPRIVATE=github.com/onmetal/* secrets: | "github_pat=${{ secrets.BOT_PAT }}" diff --git a/Dockerfile b/Dockerfile index bd4fcfd..19aa37a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,6 @@ FROM golang:1.22.0 as builder ARG GOARCH -ARG GOPRIVATE WORKDIR /workspace # Copy the Go Modules manifests @@ -12,11 +11,7 @@ COPY go.sum go.sum COPY hack/ hack/ # cache deps before building and copying source so that we don't need to re-download as much # and so that source changes don't invalidate our downloaded layer -RUN --mount=type=ssh --mount=type=secret,id=github_pat \ - --mount=type=cache,target=/root/.cache/go-build \ - --mount=type=cache,target=/go/pkg \ - GITHUB_PAT_PATH=/run/secrets/github_pat ./hack/setup-git-redirect.sh \ - && mkdir -p -m 0600 ~/.ssh \ +RUN mkdir -p -m 0600 ~/.ssh \ && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts \ && go mod download diff --git a/hack/setup-git-redirect.sh b/hack/setup-git-redirect.sh deleted file mode 100755 index ba59f4e..0000000 --- a/hack/setup-git-redirect.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [[ -f "$GITHUB_PAT_PATH" ]]; then - echo "Sourcing Github pat from path" - GITHUB_PAT="$(cat "$GITHUB_PAT_PATH")" -fi - -if [[ "$GITHUB_PAT" != "" ]]; then - echo "Rewriting to use Github pat" - git config --global url."https://${GITHUB_PAT}:x-oauth-basic@github.com/".insteadOf "https://github.com/" -else - echo "No Github pat given, rewriting to use plain ssh auth" - git config --global url."git@github.com:".insteadOf "https://github.com" -fi -