Skip to content

Commit 8d2f856

Browse files
committed
WIP: optionally install pip keyring
Signed-off-by: Jason Hall <jason@chainguard.dev>
1 parent 461e155 commit 8d2f856

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

action.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,19 @@ inputs:
7070
required: false
7171
default: apk.cgr.dev
7272

73+
libraries-host:
74+
description: |
75+
The hostname to authenticate against for Chainguard Libraries-related
76+
authentication.
77+
required: false
78+
default: libraries.cgr.dev
79+
80+
setup-python-keyring:
81+
description: |
82+
Whether to install the Chainguard Libraries pip keyring package.
83+
required: false
84+
default: false
85+
7386
runs:
7487
using: "composite"
7588

@@ -130,6 +143,13 @@ runs:
130143
fi
131144
echo "::endgroup::"
132145
146+
echo "::group::Authenticating with ${{ inputs.libraries-host }} as ${{ env.IDENTITY }}"
147+
if ! chainctl auth login --identity "${{ env.IDENTITY }}" --audience ${{ inputs.libraries-host }} -v=${{ env.VERBOSITY }}; then
148+
echo "::error Unable to assume the identity ${{ env.IDENTITY }} for ${{ inputs.libraries-host }}."
149+
exit 1
150+
fi
151+
echo "::endgroup::"
152+
133153
echo "::group::Authenticating with ${{ inputs.apk-host }} as ${{ env.IDENTITY }}"
134154
if ! chainctl auth login --identity "${{ env.IDENTITY }}" --audience ${{ inputs.apk-host }} -v=${{ env.VERBOSITY }}; then
135155
echo "::error Unable to assume the identity ${{ env.IDENTITY }} for ${{ inputs.apk-host }}."
@@ -179,3 +199,9 @@ runs:
179199
if [ "${{ env.EXPORT_AUTH }}" == "true" ]; then
180200
echo HTTP_AUTH="basic:${{ inputs.apk-host }}:user:$(chainctl auth token --audience ${{ inputs.apk-host }})" >> $GITHUB_ENV
181201
fi
202+
203+
- if: ${{ inputs.setup-python-keyring }}
204+
name: Install Python keyring package
205+
shell: bash
206+
run: |
207+
python -m pip install "keyrings-chainguard-libraries"

0 commit comments

Comments
 (0)