From 8c52bc55a06f593485be3700cdf332e73dc14205 Mon Sep 17 00:00:00 2001 From: Billy Lynch Date: Tue, 19 Aug 2025 17:45:18 -0400 Subject: [PATCH] Add apk-host variable Adds a variable for configuring the APK host to use when authenticating. --- action.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/action.yaml b/action.yaml index d394be3..99bcb3c 100644 --- a/action.yaml +++ b/action.yaml @@ -64,6 +64,12 @@ inputs: required: false default: true + apk-host: + description: | + The hostname to authenticate against for APK-related authentication. + required: false + default: apk.cgr.dev + runs: using: "composite" @@ -121,8 +127,8 @@ runs: echo Unable to assume the identity ${{ env.IDENTITY }}. exit 1 fi - if ! chainctl auth login --identity "${{ env.IDENTITY }}" --audience apk.cgr.dev -v=${{ env.VERBOSITY }}; then - echo Unable to assume the identity ${{ env.IDENTITY }} for apk.cgr.dev. + if ! chainctl auth login --identity "${{ env.IDENTITY }}" --audience ${{ inputs.apk-host }} -v=${{ env.VERBOSITY }}; then + echo Unable to assume the identity ${{ env.IDENTITY }} for ${{ inputs.apk-host }}. exit 1 fi if ! chainctl auth configure-docker --identity "${{ env.IDENTITY }}" -v=${{ env.VERBOSITY }}; then @@ -130,7 +136,7 @@ runs: exit 1 fi if [ "${{ env.EXPORT_AUTH }}" == "true" ]; then - echo HTTP_AUTH="basic:apk.cgr.dev:user:$(chainctl auth token --audience apk.cgr.dev)" >> $GITHUB_ENV + echo HTTP_AUTH="basic:${{ inputs.apk-host }}:user:$(chainctl auth token --audience ${{ inputs.apk-host }})" >> $GITHUB_ENV fi - name: Authenticate with Chainguard (DEPRECATED invite-code) @@ -160,5 +166,5 @@ runs: exit 1 fi if [ "${{ env.EXPORT_AUTH }}" == "true" ]; then - echo HTTP_AUTH="basic:apk.cgr.dev:user:$(chainctl auth token --audience apk.cgr.dev)" >> $GITHUB_ENV + echo HTTP_AUTH="basic:${{ inputs.apk-host }}:user:$(chainctl auth token --audience ${{ inputs.apk-host }})" >> $GITHUB_ENV fi