4343 k8s_latest : ${{ steps.vars.outputs.k8s_latest }}
4444 go_path : ${{ steps.vars.outputs.go_path }}
4545 go_code_md5 : ${{ steps.vars.outputs.go_code_md5 }}
46+ go_proxy : ${{ steps.vars.outputs.go_proxy }}
4647 binary_cache_hit : ${{ steps.binary-cache.outputs.cache-hit }}
4748 chart_version : ${{ steps.vars.outputs.chart_version }}
4849 ic_version : ${{ steps.vars.outputs.ic_version }}
9899 source .github/data/version.txt
99100 echo "ic_version=${IC_VERSION}" >> $GITHUB_OUTPUT
100101 echo "chart_version=${HELM_CHART_VERSION}" >> $GITHUB_OUTPUT
101- echo "forked_workflow=${{ (github.event.pull_request && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) || github.repository != 'nginx/kubernetes-ingress' }}" >> $GITHUB_OUTPUT
102+ forked_workflow=${{ (github.event.pull_request && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) || github.repository != 'nginx/kubernetes-ingress' }}
103+ echo "forked_workflow=${forked_workflow}" >> $GITHUB_OUTPUT
104+ go_proxy="https://proxy.golang.org,direct"
105+ if [ "$forked_workflow" = "false" ]; then
106+ go_proxy="https://azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev"
107+ fi
108+ echo "go_proxy=${go_proxy}" >> $GITHUB_OUTPUT
102109 ./.github/scripts/variables.sh go_code_md5 >> $GITHUB_OUTPUT
103110 ./.github/scripts/variables.sh docker_md5 >> $GITHUB_OUTPUT
104111 ./.github/scripts/variables.sh build_tag >> $GITHUB_OUTPUT
@@ -125,7 +132,7 @@ jobs:
125132
126133 - name : Authenticate to Google Cloud
127134 id : auth
128- uses : google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
135+ uses : google-github-actions/auth@140bb5113ffb6b65a7e9b937a81fa96cf5064462 # v2.1.11
129136 with :
130137 token_format : access_token
131138 workload_identity_provider : ${{ secrets.GCR_WORKLOAD_IDENTITY }}
@@ -173,6 +180,8 @@ jobs:
173180 permissions :
174181 contents : read
175182 needs : checks
183+ env :
184+ GOPROXY : ${{ needs.checks.outputs.go_proxy }}
176185 steps :
177186 - name : Checkout Repository
178187 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -183,6 +192,16 @@ jobs:
183192 go-version-file : go.mod
184193 if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
185194
195+ - name : Setup netrc
196+ run : |
197+ cat <<EOF > $HOME/.netrc
198+ machine azr.artifactory.f5net.com
199+ login ${{ secrets.ARTIFACTORY_USER }}
200+ password ${{ secrets.ARTIFACTORY_TOKEN }}
201+ EOF
202+ chmod 600 $HOME/.netrc
203+ if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}
204+
186205 - name : Check if go.mod and go.sum are up to date
187206 run : go mod tidy && git diff --exit-code -- go.mod go.sum
188207 if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
@@ -212,6 +231,8 @@ jobs:
212231 name : Unit Tests
213232 runs-on : ubuntu-22.04
214233 needs : checks
234+ env :
235+ GOPROXY : ${{ needs.checks.outputs.go_proxy }}
215236 steps :
216237 - name : Checkout Repository
217238 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -222,6 +243,16 @@ jobs:
222243 go-version-file : go.mod
223244 if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
224245
246+ - name : Setup netrc
247+ run : |
248+ cat <<EOF > $HOME/.netrc
249+ machine azr.artifactory.f5net.com
250+ login ${{ secrets.ARTIFACTORY_USER }}
251+ password ${{ secrets.ARTIFACTORY_TOKEN }}
252+ EOF
253+ chmod 600 $HOME/.netrc
254+ if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}
255+
225256 - name : Run Tests
226257 run : make cover
227258 if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
@@ -260,6 +291,16 @@ jobs:
260291 go-version-file : go.mod
261292 if : ${{ (inputs.force && inputs.force || false) || needs.checks.outputs.binary_cache_hit != 'true' }}
262293
294+ - name : Setup netrc
295+ run : |
296+ cat <<EOF > $HOME/.netrc
297+ machine azr.artifactory.f5net.com
298+ login ${{ secrets.ARTIFACTORY_USER }}
299+ password ${{ secrets.ARTIFACTORY_TOKEN }}
300+ EOF
301+ chmod 600 $HOME/.netrc
302+ if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}
303+
263304 - name : Build binaries
264305 uses : goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
265306 with :
@@ -268,6 +309,7 @@ jobs:
268309 env :
269310 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
270311 GOPATH : ${{ needs.checks.outputs.go_path }}
312+ GOPROXY : ${{ needs.checks.outputs.go_proxy }}
271313 AWS_PRODUCT_CODE : ${{ secrets.AWS_PRODUCT_CODE }}
272314 AWS_PUB_KEY : ${{ secrets.AWS_PUB_KEY }}
273315 AWS_NAP_DOS_PRODUCT_CODE : ${{ secrets.AWS_NAP_DOS_PRODUCT_CODE }}
@@ -398,7 +440,7 @@ jobs:
398440
399441 - name : Authenticate to Google Cloud
400442 id : auth
401- uses : google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
443+ uses : google-github-actions/auth@140bb5113ffb6b65a7e9b937a81fa96cf5064462 # v2.1.11
402444 with :
403445 token_format : access_token
404446 workload_identity_provider : ${{ secrets.GCR_WORKLOAD_IDENTITY }}
@@ -463,7 +505,7 @@ jobs:
463505
464506 - name : Authenticate to Google Cloud
465507 id : auth
466- uses : google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
508+ uses : google-github-actions/auth@140bb5113ffb6b65a7e9b937a81fa96cf5064462 # v2.1.11
467509 with :
468510 token_format : access_token
469511 workload_identity_provider : ${{ secrets.GCR_WORKLOAD_IDENTITY }}
@@ -603,7 +645,7 @@ jobs:
603645
604646 - name : Authenticate to Google Cloud
605647 id : auth
606- uses : google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
648+ uses : google-github-actions/auth@140bb5113ffb6b65a7e9b937a81fa96cf5064462 # v2.1.11
607649 with :
608650 token_format : access_token
609651 workload_identity_provider : ${{ secrets.GCR_WORKLOAD_IDENTITY }}
0 commit comments