Skip to content

Commit bec8dc5

Browse files
authored
Add apk-host variable (#29)
Adds a variable for configuring the APK host to use when authenticating.
1 parent 9a109b0 commit bec8dc5

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

action.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ inputs:
6464
required: false
6565
default: true
6666

67+
apk-host:
68+
description: |
69+
The hostname to authenticate against for APK-related authentication.
70+
required: false
71+
default: apk.cgr.dev
72+
6773
runs:
6874
using: "composite"
6975

@@ -121,16 +127,16 @@ runs:
121127
echo Unable to assume the identity ${{ env.IDENTITY }}.
122128
exit 1
123129
fi
124-
if ! chainctl auth login --identity "${{ env.IDENTITY }}" --audience apk.cgr.dev -v=${{ env.VERBOSITY }}; then
125-
echo Unable to assume the identity ${{ env.IDENTITY }} for apk.cgr.dev.
130+
if ! chainctl auth login --identity "${{ env.IDENTITY }}" --audience ${{ inputs.apk-host }} -v=${{ env.VERBOSITY }}; then
131+
echo Unable to assume the identity ${{ env.IDENTITY }} for ${{ inputs.apk-host }}.
126132
exit 1
127133
fi
128134
if ! chainctl auth configure-docker --identity "${{ env.IDENTITY }}" -v=${{ env.VERBOSITY }}; then
129135
echo Unable to register credential helper as ${{ env.IDENTITY }}.
130136
exit 1
131137
fi
132138
if [ "${{ env.EXPORT_AUTH }}" == "true" ]; then
133-
echo HTTP_AUTH="basic:apk.cgr.dev:user:$(chainctl auth token --audience apk.cgr.dev)" >> $GITHUB_ENV
139+
echo HTTP_AUTH="basic:${{ inputs.apk-host }}:user:$(chainctl auth token --audience ${{ inputs.apk-host }})" >> $GITHUB_ENV
134140
fi
135141
136142
- name: Authenticate with Chainguard (DEPRECATED invite-code)
@@ -160,5 +166,5 @@ runs:
160166
exit 1
161167
fi
162168
if [ "${{ env.EXPORT_AUTH }}" == "true" ]; then
163-
echo HTTP_AUTH="basic:apk.cgr.dev:user:$(chainctl auth token --audience apk.cgr.dev)" >> $GITHUB_ENV
169+
echo HTTP_AUTH="basic:${{ inputs.apk-host }}:user:$(chainctl auth token --audience ${{ inputs.apk-host }})" >> $GITHUB_ENV
164170
fi

0 commit comments

Comments
 (0)