-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
47 lines (47 loc) · 1.84 KB
/
Copy pathaction.yml
File metadata and controls
47 lines (47 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Setup Artifactory Go Proxy
description: Composite GitHub Action that signs into Artifactory with OIDC and returns the URL of the Go Module Proxy
inputs:
artifactory-domain:
description: Artifactory domain
required: false
default: edge.urm.nvidia.com
artifactory-repository:
description: Artifactory repository
required: false
default: edge-go-remote-virtual
oidc-audience:
description: Value of the `aud` claim for the OIDC token
required: false
default: edge.urm.nvidia.com
oidc-provider-name:
description: Value of the Artifactory OIDC provider name
required: false
default: nvgithub
outputs:
goproxy-url:
description: The URL to the Go module proxy (to be used by the GOPROXY environment variable).
value: ${{ steps.get-goproxy.outputs.goproxy-url }}
runs:
using: composite
steps:
- name: Setup JFrog CLI
id: jfrog
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: "https://${{ inputs.artifactory-domain }}"
with:
oidc-provider-name: ${{ inputs.oidc-provider-name }}
oidc-audience: "${{ inputs.oidc-audience }}"
- name: Retrieve the Artifactory GOPROXY
id: get-goproxy
env:
OIDC_USER: "${{ steps.jfrog.outputs.oidc-user }}"
OIDC_TOKEN: "${{ steps.jfrog.outputs.oidc-token }}"
ARTIFACTORY_DOMAIN: "${{ inputs.artifactory-domain }}"
ARTIFACTORY_REPOSITORY: "${{ inputs.artifactory-repository }}"
run: |
# URL encode special characters to prevent errors w/ basic auth
OIDC_USER_ENCODED=$(python3 -c 'import urllib.parse, os; print(urllib.parse.quote_plus(os.environ["OIDC_USER"]))')
export GOPROXY="https://${OIDC_USER_ENCODED}:${OIDC_TOKEN}@${ARTIFACTORY_DOMAIN}/artifactory/api/go/${ARTIFACTORY_REPOSITORY}"
echo "goproxy-url=$GOPROXY" >> $GITHUB_OUTPUT
shell: bash