From f882c8480ca51cf7281184a74984a3a545736621 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 5 May 2022 09:56:29 +0200 Subject: [PATCH] Configure the github release action for private go modules (#12) * Configure the github release action for private go modules - cluster-controller (private repo) was introduced as a go dep and we need to do the classic git hacks to allow go mod to read the new private repo dependency * Configure docker host's git for private go modules too --- .github/workflows/release.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6b044d9..e473f70 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,6 +2,9 @@ on: push: tags: [v*.*.*] +env: + GOPRIVATE: github.com/weaveworks/cluster-controller + name: release jobs: build: @@ -16,7 +19,15 @@ jobs: with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} + - name: Configure git for private modules + env: + GITHUB_BUILD_USERNAME: ${{ secrets.BUILD_BOT_USER }} + GITHUB_BUILD_TOKEN: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN }} + run: git config --global url."https://${GITHUB_BUILD_USERNAME}:${GITHUB_BUILD_TOKEN}@github.com".insteadOf "https://github.com" - name: Build docker image + env: + GITHUB_BUILD_USERNAME: ${{ secrets.BUILD_BOT_USER }} + GITHUB_BUILD_TOKEN: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN }} run: | make docker-build - name: Login to Docker Hub