Skip to content

Commit 963a268

Browse files
committed
fix variable check when setting up
1 parent a03f7cf commit 963a268

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@ permissions:
2020

2121
env:
2222
NFPM_VERSION: 'v2.35.3'
23-
GOPROXY: "https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev"
23+
GOPROXY_DEV: "azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev"
24+
GOPROXY: "direct"
2425

2526
jobs:
26-
set-vars:
27+
28+
vars:
29+
name: Set Workflow Variables
2730
runs-on: ubuntu-22.04
31+
if: ${{ ! github.event.pull_request.head.repo.fork }}
2832
steps:
29-
- name: Set Variables
33+
- name: Set GOPROXY
3034
run: |
31-
if [[ -z ${{ secrets.ARTIFACTORY_USER }} ]] ||
32-
[[ -z ${{ secrets.ARTIFACTORY_TOKEN }} ]] ||
33-
${{ github.event.pull_request.head.repo.fork }}; then
34-
echo "GOPROXY=direct" >> $GITHUB_ENV
35+
if [[ ! -z ${{ secrets.ARTIFACTORY_USER }} ]] && [[ ! -z ${{ secrets.ARTIFACTORY_TOKEN }} ]]; then
36+
echo "GOPROXY=https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ env.GOPROXY_DEV }}" >> $GITHUB_ENV
3537
fi
3638
3739
lint:

0 commit comments

Comments
 (0)