From fc7c18c4c690bb5c07d4e2b7c81057af797ef193 Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Tue, 7 Jun 2022 19:49:28 +0200 Subject: [PATCH] dependabot: implement workaround to run generate go openapi in GOPATH --- .github/workflows/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index ea01de250df4..4ce67be3703b 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -19,8 +19,15 @@ jobs: with: go-version: '1.17' id: go + # Note: We have to run everything in the GOPATH as `make generate-go-openapi` + # currently does not work outside of the GOPATH, see: + # https://github.com/kubernetes-sigs/cluster-api/issues/6526 - name: Check out code into the Go module directory uses: actions/checkout@v3 + with: + path: './src/sigs.k8s.io/cluster-api' + - name: Set env + run: echo "GOPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV - uses: actions/cache@v3.0.3 name: Restore go cache with: @@ -32,8 +39,10 @@ jobs: ${{ runner.os }}-go- - name: Update all modules run: make generate-modules + working-directory: './src/sigs.k8s.io/cluster-api' - name: Update generated code run: make generate + working-directory: './src/sigs.k8s.io/cluster-api' - uses: EndBug/add-and-commit@v9 name: Commit changes with: @@ -41,3 +50,4 @@ jobs: author_email: 49699333+dependabot[bot]@users.noreply.github.com default_author: github_actor message: 'Update generated code' + cwd: './src/sigs.k8s.io/cluster-api'