Skip to content

Commit

Permalink
fix: port uds-common/setup action
Browse files Browse the repository at this point in the history
Signed-off-by: catsby <clint@defenseunicorns.com>
  • Loading branch information
catsby committed Oct 28, 2024
1 parent 49bb437 commit cc6491d
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
56 changes: 56 additions & 0 deletions .github/actions/setup-environment/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Setup Environment
description: UDS Environment Setup

# This action was lifted from the uds-common repo as of v0.13.1, before
# uds-common was refactored and this action was subsequently removed.

inputs:
registry1Username:
description: Registry1 Username
registry1Password:
description: Registry1 Password
ghToken:
description: GitHub Token
chainguardIdentity:
description: ID for Chainguard Identity to assume

runs:
using: composite
steps:
- name: Install k3d
shell: bash
# renovate: datasource=github-tags depName=k3d-io/k3d versioning=semver
run: curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=v5.7.4 bash

- name: Install UDS CLI
uses: defenseunicorns/setup-uds@b987a32bac3baeb67bfb08f5e1544e2f9076ee8a # v1.0.0
with:
# renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver
version: v0.18.0

- name: Install Lula
uses: defenseunicorns/lula-action/setup@696a9c6e4071dfa281185ca937de330effb85fca
with:
# renovate: datasource=github-tags depName=defenseunicorns/lula versioning=semver-coerced
version: v0.7.0

- name: Iron Bank Login
if: ${{ inputs.registry1Username != '' }}
env:
REGISTRY_USERNAME: ${{ inputs.registry1Username }}
REGISTRY_PASSWORD: ${{ inputs.registry1Password }}
run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil
shell: bash

- name: Chainguard Login
if: ${{ inputs.chainguardIdentity != '' }}
uses: chainguard-dev/setup-chainctl@f52718d822dc73d21a04ef2082822c4a203163b3 # v0.2.2
with:
identity: ${{ inputs.chainguardIdentity }}

- name: GHCR Login
if: ${{ inputs.ghToken != '' }}
env:
GH_TOKEN: ${{ inputs.ghToken }}
run: echo "${{ env.GH_TOKEN }}" | uds zarf tools registry login -u "dummy" --password-stdin ghcr.io
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- name: Setup UDS
if: always()
uses: defenseunicorns/uds-common/.github/actions/setup@e3008473beab00b12a94f9fcc7340124338d5c08 # v0.13.1
uses: ./.github/actions/setup-environment
with:
username: ${{secrets.IRON_BANK_ROBOT_USERNAME}}
password: ${{secrets.IRON_BANK_ROBOT_PASSWORD}}
Expand Down

0 comments on commit cc6491d

Please sign in to comment.