Skip to content

Commit 8810e68

Browse files
committed
set GOPROXY to direct in cases where secrets re not present, or the repo is a fork
1 parent 6744bac commit 8810e68

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,19 @@ 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|direct"
23+
GOPROXY: "https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev"
2424

2525
jobs:
26+
set-vars:
27+
runs-on: ubuntu-22.04
28+
steps:
29+
- name: Set Variables
30+
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+
2636
lint:
2737
name: Lint
2838
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)