Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ inputs:
required: false
default: apk.cgr.dev

libraries-host:
description: |
The hostname to authenticate against for Chainguard Libraries-related
authentication.
required: false
default: libraries.cgr.dev

setup-python-keyring:
description: |
Whether to install the Chainguard Libraries pip keyring package.
required: false
default: false

runs:
using: "composite"

Expand Down Expand Up @@ -130,6 +143,13 @@ runs:
fi
echo "::endgroup::"

echo "::group::Authenticating with ${{ inputs.libraries-host }} as ${{ env.IDENTITY }}"
if ! chainctl auth login --identity "${{ env.IDENTITY }}" --audience ${{ inputs.libraries-host }} -v=${{ env.VERBOSITY }}; then
echo "::error Unable to assume the identity ${{ env.IDENTITY }} for ${{ inputs.libraries-host }}."
exit 1
fi
echo "::endgroup::"

echo "::group::Authenticating with ${{ inputs.apk-host }} as ${{ env.IDENTITY }}"
if ! chainctl auth login --identity "${{ env.IDENTITY }}" --audience ${{ inputs.apk-host }} -v=${{ env.VERBOSITY }}; then
echo "::error Unable to assume the identity ${{ env.IDENTITY }} for ${{ inputs.apk-host }}."
Expand Down Expand Up @@ -179,3 +199,9 @@ runs:
if [ "${{ env.EXPORT_AUTH }}" == "true" ]; then
echo HTTP_AUTH="basic:${{ inputs.apk-host }}:user:$(chainctl auth token --audience ${{ inputs.apk-host }})" >> $GITHUB_ENV
fi

- if: ${{ inputs.setup-python-keyring }}
name: Install Python keyring package
shell: bash
run: |
python -m pip install "keyrings-chainguard-libraries"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will use our things?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this will use https://pypi.org/project/keyrings-chainguard-libraries/ which is currently in a private repo, but which we'll make public next week.