diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da6b59f56..cbfd9ccb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,20 +23,26 @@ env: GOPROXY: "https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev" jobs: + set-vars: + name: Set Variables runs-on: ubuntu-22.04 + outputs: + goproxy: ${{ steps.set-vars.outputs.goproxy }} steps: - name: Set Variables - run: | - if [[ -z ${{ secrets.ARTIFACTORY_USER }} ]] || - [[ -z ${{ secrets.ARTIFACTORY_TOKEN }} ]] || - ${{ github.event.pull_request.head.repo.fork }}; then - echo "GOPROXY=direct" >> $GITHUB_ENV + run: + | + if [[ -z ${{ github.event.pull_request.head.repo.fork }} ]]; then + echo "GOPROXY=${{ env.GOPROXY }}" >> $GITHUB_ENV + else + echo "GOPROXY=direct" >> $GITHUB_ENV fi - lint: name: Lint runs-on: ubuntu-22.04 + env: + GOPROXY: ${{ needs.set-vars.outputs.goproxy }} steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 @@ -50,6 +56,8 @@ jobs: unit-test: name: Unit Tests runs-on: ubuntu-22.04 + env: + GOPROXY: ${{ needs.set-vars.outputs.goproxy }} steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 @@ -69,6 +77,8 @@ jobs: race-condition-test: name: Unit tests with race condition detection runs-on: ubuntu-22.04 + env: + GOPROXY: ${{ needs.set-vars.outputs.goproxy }} steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 @@ -80,6 +90,8 @@ jobs: build-unsigned-snapshot: name: Build Unsigned Snapshot runs-on: ubuntu-22.04 + env: + GOPROXY: ${{ needs.set-vars.outputs.goproxy }} steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 @@ -102,6 +114,8 @@ jobs: name: Integration Tests needs: build-unsigned-snapshot runs-on: ubuntu-22.04 + env: + GOPROXY: ${{ needs.set-vars.outputs.goproxy }} strategy: matrix: container: @@ -223,6 +237,8 @@ jobs: performance-tests: name: Performance Tests runs-on: ubuntu-22.04 + env: + GOPROXY: ${{ needs.set-vars.outputs.goproxy }} permissions: contents: write steps: