Skip to content

Commit 50a68bc

Browse files
authored
Update goproxy logic & cleanup netrc (#8421)
* Update goproxy logic & cleanup netrc * don't echo empty variable
1 parent 9636e7b commit 50a68bc

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

.github/workflows/build-artifacts.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ jobs:
190190
# with:
191191
# assertion-doc: ${{ steps.assertiondoc.outputs.assertion-document-path }}
192192

193+
- name: Cleanup netrc
194+
run: rm -f $HOME/.netrc
195+
if: ${{ always() }}
196+
193197
build-docker:
194198
name: Build Docker OSS
195199
needs: [binaries]

.github/workflows/ci.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ jobs:
102102
echo "chart_version=${HELM_CHART_VERSION}" >> $GITHUB_OUTPUT
103103
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' }}
104104
echo "forked_workflow=${forked_workflow}" >> $GITHUB_OUTPUT
105-
go_proxy="https://proxy.golang.org,direct"
106-
if [ "$forked_workflow" = "false" ]; then
107-
go_proxy="${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
108-
elif [ "${{ github.ref_name }}" = "main" ] || [[ "${{ github.ref_name }}" =~ "release-" ]]; then
109-
go_proxy="${{ secrets.ARTIFACTORY_ENDPOINT }}"
105+
if [ "$forked_workflow" = "false" ] && [ "${{ github.ref_name }}" != "${{ github.event.repository.default_branch }}" ]; then
106+
echo "go_proxy=${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}" >> $GITHUB_OUTPUT
107+
elif [ "${{ github.ref_name }}" = "${{ github.event.repository.default_branch }}" ] || [[ "${{ github.ref_name }}" =~ "release-" ]]; then
108+
echo "go_proxy=${{ secrets.ARTIFACTORY_ENDPOINT }}" >> $GITHUB_OUTPUT
109+
else
110+
echo "go_proxy=https://proxy.golang.org,direct" >> $GITHUB_OUTPUT
110111
fi
111-
echo "go_proxy=${go_proxy}" >> $GITHUB_OUTPUT
112112
./.github/scripts/variables.sh go_code_md5 >> $GITHUB_OUTPUT
113113
./.github/scripts/variables.sh docker_md5 >> $GITHUB_OUTPUT
114114
./.github/scripts/variables.sh build_tag >> $GITHUB_OUTPUT
@@ -241,6 +241,10 @@ jobs:
241241
make telemetry-schema && git diff --name-only --exit-code internal/telemetry
242242
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
243243

244+
- name: Cleanup netrc
245+
run: rm -f $HOME/.netrc
246+
if: ${{ always() }}
247+
244248
unit-tests:
245249
name: Unit Tests
246250
runs-on: ubuntu-24.04
@@ -290,6 +294,10 @@ jobs:
290294
install-go: false
291295
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
292296

297+
- name: Cleanup netrc
298+
run: rm -f $HOME/.netrc
299+
if: ${{ always() }}
300+
293301
build-artifacts:
294302
name: Build Artifacts
295303
needs: [checks, unit-tests, verify-codegen]

.github/workflows/image-promotion.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ jobs:
146146
with:
147147
sarif_file: govulncheck.sarif
148148

149+
- name: Cleanup netrc
150+
run: rm -f $HOME/.netrc
151+
if: ${{ always() }}
152+
149153
build-artifacts:
150154
name: Build Artifacts
151155
needs: [checks]

0 commit comments

Comments
 (0)