@@ -14,6 +14,13 @@ inputs:
14
14
required : true
15
15
default : enforce.dev
16
16
17
+ env-auth :
18
+ description : |
19
+ Determines if we export HTTP_AUTH env variable with chainctl auth
20
+ token.
21
+ required : false
22
+ default : false
23
+
17
24
identity :
18
25
description : |
19
26
The id of the identity that this workflow should assume for
94
101
VERBOSITY : ${{ inputs.verbosity }}
95
102
IDENTITY : ${{ inputs.identity }}
96
103
CHAINCTL_CONFIG : ${{ inputs.config-path }}
104
+ EXPORT_AUTH : ${{ inputs.env-auth }}
97
105
run : |
98
106
if chainctl auth login --identity "${{ env.IDENTITY }}" -v=${{ env.VERBOSITY }}; then
99
107
echo Logged in as ${{ env.IDENTITY }}!
@@ -105,6 +113,9 @@ runs:
105
113
echo Unable to register credential helper as ${{ env.IDENTITY }}.
106
114
exit 1
107
115
fi
116
+ if [ "${{ env.EXPORT_AUTH }}" == "true" ]; then
117
+ echo HTTP_AUTH="basic:apk.cgr.dev:user:$(shell chainctl auth token --audience apk.cgr.dev)" >> $GITHUB_ENV
118
+ fi
108
119
109
120
- name : Authenticate with Chainguard (DEPRECATED invite-code)
110
121
shell : bash
@@ -115,6 +126,7 @@ runs:
115
126
VERBOSITY : ${{ inputs.verbosity }}
116
127
ENVIRONMENT : ${{ inputs.environment }}
117
128
AUDIENCE : ${{ inputs.audience }}
129
+ EXPORT_AUTH : ${{ inputs.env-auth }}
118
130
run : |
119
131
echo "::warning::The use of invite codes with Github actions is deprecated, use assumed identities instead."
120
132
@@ -131,3 +143,6 @@ runs:
131
143
echo Failed to log in with invite code
132
144
exit 1
133
145
fi
146
+ if [ "${{ env.EXPORT_AUTH }}" == "true" ]; then
147
+ echo HTTP_AUTH="basic:apk.cgr.dev:user:$(shell chainctl auth token --audience apk.cgr.dev)" >> $GITHUB_ENV
148
+ fi
0 commit comments