Skip to content

Commit d938de4

Browse files
committed
create netrc file
1 parent 510406c commit d938de4

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
echo "forked_workflow=${forked_workflow}" >> $GITHUB_OUTPUT
104104
go_proxy=""
105105
if [ "$forked_workflow" = "false" ]; then
106-
go_proxy="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev"
106+
go_proxy="https://azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev"
107107
fi
108108
echo "go_proxy=${go_proxy}" >> $GITHUB_OUTPUT
109109
./.github/scripts/variables.sh go_code_md5 >> $GITHUB_OUTPUT
@@ -190,31 +190,21 @@ jobs:
190190
with:
191191
fetch-depth: 0
192192

193-
- name: Print Go environment variables
194-
id: vars
193+
- name: Setup netrc
195194
run: |
196-
echo "go_path=${{ needs.checks.outputs.go_path }}"
197-
echo "go_path=${{ needs.checks.outputs.go_path }}" >> $GITHUB_OUTPUT
198-
echo "go_proxy=${{ needs.checks.outputs.go_proxy }}"
199-
echo "go_proxy=${{ needs.checks.outputs.go_proxy }}" >> $GITHUB_OUTPUT
200-
env:
201-
GOPROXY: ${{ needs.checks.outputs.go_proxy }}
202-
GOPATH: ${{ needs.checks.outputs.go_path }}
195+
cat <<EOF > $HOME/.netrc
196+
machine azr.artifactory.f5net.com
197+
login ${{ secrets.ARTIFACTORY_USER }}
198+
password ${{ secrets.ARTIFACTORY_TOKEN }}
199+
EOF
200+
chmod 600 $HOME/.netrc
203201
204202
- name: Setup Golang Environment
205203
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
206204
with:
207205
go-version-file: go.mod
208206
if: ${{ (inputs.force && inputs.force || false) || needs.checks.outputs.binary_cache_hit != 'true' }}
209207

210-
- name: Print Go environment variables
211-
run: |
212-
echo "go_path=${GOPATH}"
213-
echo "go_proxy=${GOPROXY}"
214-
env:
215-
GOPROXY: ${{ steps.vars.outputs.go_proxy }}
216-
GOPATH: ${{ steps.vars.outputs.go_path }}
217-
218208
- name: Build binaries
219209
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
220210
with:
@@ -223,7 +213,7 @@ jobs:
223213
env:
224214
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
225215
GOPATH: ${{ needs.checks.outputs.go_path }}
226-
GOPROXY: ${{ steps.vars.outputs.go_proxy }}
216+
GOPROXY: ${{ needs.checks.outputs.go_proxy }}
227217
AWS_PRODUCT_CODE: ${{ secrets.AWS_PRODUCT_CODE }}
228218
AWS_PUB_KEY: ${{ secrets.AWS_PUB_KEY }}
229219
AWS_NAP_DOS_PRODUCT_CODE: ${{ secrets.AWS_NAP_DOS_PRODUCT_CODE }}

0 commit comments

Comments
 (0)