Skip to content

Commit 30dca89

Browse files
committed
Second attempt
1 parent 4938629 commit 30dca89

File tree

5 files changed

+53
-11
lines changed

5 files changed

+53
-11
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ defaults:
2929
run:
3030
shell: bash
3131

32-
env:
33-
GOPROXY: ${{ github.repository_owner != 'nginx' && 'direct' || (inputs.is_production_release || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_ENDPOINT) || format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_DEV_ENDPOINT) }}
34-
3532
concurrency:
3633
group: ${{ github.ref_name }}-ci
3734
cancel-in-progress: true
@@ -53,6 +50,17 @@ jobs:
5350
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5451
with:
5552
fetch-depth: 0
53+
- name: Configure GOPROXY
54+
run: |
55+
if [[ "${{ github.repository_owner }}" != "nginx" ]]; then
56+
GOPROXY_VALUE="direct"
57+
elif [[ "${{ inputs.is_production_release }}" == "true" ]] || [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
58+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_ENDPOINT }}"
59+
else
60+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
61+
fi
62+
echo "goproxy=${GOPROXY_VALUE}" >> $GITHUB_OUTPUT
63+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
5664
5765
- name: Setup Golang Environment
5866
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
@@ -92,6 +100,8 @@ jobs:
92100
name: Unit Tests
93101
runs-on: ubuntu-24.04
94102
needs: vars
103+
env:
104+
GOPROXY: ${{ needs.vars.outputs.goproxy }}
95105
steps:
96106
- name: Checkout Repository
97107
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -144,6 +154,8 @@ jobs:
144154
name: Build Binary
145155
runs-on: ${{ github.repository_owner == 'nginx' && (inputs.is_production_release || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && 'ubuntu-24.04-amd64' || 'ubuntu-24.04' }}
146156
needs: [vars, unit-tests, njs-unit-tests]
157+
env:
158+
GOPROXY: ${{ needs.vars.outputs.goproxy }}
147159
permissions:
148160
contents: write # for goreleaser/goreleaser-action and lucacome/draft-release to create/update releases
149161
id-token: write # for goreleaser/goreleaser-action to sign artifacts
@@ -345,6 +357,8 @@ jobs:
345357
name: CEL Tests
346358
runs-on: ubuntu-24.04
347359
needs: vars
360+
env:
361+
GOPROXY: ${{ needs.vars.outputs.goproxy }}
348362
steps:
349363
- name: Checkout Repository
350364
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

.github/workflows/conformance.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ defaults:
2828
env:
2929
PLUS_USAGE_ENDPOINT: ${{ secrets.JWT_PLUS_REPORTING_ENDPOINT }}
3030
ENABLE_EXPERIMENTAL: ${{ inputs.enable-experimental }}
31-
GOPROXY: ${{ github.repository_owner != 'nginx' && 'direct' || format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_DEV_ENDPOINT) }}
3231

3332
permissions:
3433
contents: read
@@ -48,6 +47,15 @@ jobs:
4847
with:
4948
fetch-depth: 0
5049

50+
- name: Configure GOPROXY
51+
run: |
52+
if [[ "${{ github.repository_owner }}" != "nginx" ]]; then
53+
GOPROXY_VALUE="direct"
54+
else
55+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
56+
fi
57+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
58+
5159
- name: Setup Golang Environment
5260
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
5361
with:

.github/workflows/functional.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ defaults:
1616

1717
env:
1818
PLUS_USAGE_ENDPOINT: ${{ secrets.JWT_PLUS_REPORTING_ENDPOINT }}
19-
GOPROXY: ${{ github.repository_owner != 'nginx' && 'direct' || format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_DEV_ENDPOINT) }}
2019

2120
permissions:
2221
contents: read
@@ -34,6 +33,15 @@ jobs:
3433
with:
3534
fetch-depth: 0
3635

36+
- name: Configure GOPROXY
37+
run: |
38+
if [[ "${{ github.repository_owner }}" != "nginx" ]]; then
39+
GOPROXY_VALUE="direct"
40+
else
41+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
42+
fi
43+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
44+
3745
- name: Setup Golang Environment
3846
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
3947
with:

.github/workflows/lint.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ defaults:
1212
run:
1313
shell: bash
1414

15-
env:
16-
GOPROXY: ${{ github.repository_owner != 'nginx' && 'direct' || format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_DEV_ENDPOINT) }}
17-
1815
concurrency:
1916
group: ${{ github.ref_name }}-lint
2017
cancel-in-progress: true
@@ -34,6 +31,15 @@ jobs:
3431
- name: Checkout Repository
3532
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3633

34+
- name: Configure GOPROXY
35+
run: |
36+
if [[ "${{ github.repository_owner }}" != "nginx" ]]; then
37+
GOPROXY_VALUE="direct"
38+
else
39+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
40+
fi
41+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
42+
3743
- name: Setup Golang Environment
3844
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
3945
with:

.github/workflows/renovate-build.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ defaults:
1111
run:
1212
shell: bash
1313

14-
env:
15-
GOPROXY: ${{ github.repository_owner != 'nginx' && 'direct' || format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_DEV_ENDPOINT) }}
16-
1714
concurrency:
1815
group: ${{ github.ref_name }}-renovate
1916
cancel-in-progress: true
@@ -53,6 +50,15 @@ jobs:
5350
with:
5451
ref: ${{ github.head_ref }}
5552

53+
- name: Configure GOPROXY
54+
run: |
55+
if [[ "${{ github.repository_owner }}" != "nginx" ]]; then
56+
GOPROXY_VALUE="direct"
57+
else
58+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
59+
fi
60+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
61+
5662
- name: Setup Golang Environment
5763
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
5864
with:

0 commit comments

Comments
 (0)