Skip to content

Commit ebd3087

Browse files
fix: remove deprecated registry login and add env setup (#443)
## Description uds-common removed the task for registry login and moved that logic in to the env setup github action. This PR reworks our use of the deprecated registry-login task and uses that env setup. ## Related Issue Fixes #296 ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [x] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/uds-template-capability/blob/main/CONTRIBUTING.md)(https://github.com/defenseunicorns/uds-template-capability/blob/main/CONTRIBUTING.md#submitting-a-pull-request) followed
1 parent e1f7879 commit ebd3087

File tree

4 files changed

+26
-25
lines changed

4 files changed

+26
-25
lines changed

.github/actions/setup/action.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
name: "Setup Environment"
33
description: "UDS Environment Setup"
44
inputs:
5-
gh_token:
5+
ghToken:
66
description: 'GITHUB_TOKEN'
77
required: true
8-
ib_user:
8+
registry1Username:
99
description: 'IRON_BANK_ROBOT_USERNAME'
1010
required: true
11-
ib_password:
11+
registry1Password:
1212
description: 'IRON_BANK_ROBOT_PASSWORD'
1313
required: true
1414

@@ -31,3 +31,18 @@ runs:
3131
shell: bash
3232
# renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver
3333
run: brew install defenseunicorns/tap/[email protected]
34+
35+
- name: Iron Bank Login
36+
if: ${{ inputs.registry1Username != '' }}
37+
env:
38+
REGISTRY_USERNAME: ${{ inputs.registry1Username }}
39+
REGISTRY_PASSWORD: ${{ inputs.registry1Password }}
40+
run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil
41+
shell: bash
42+
43+
- name: GHCR Login
44+
if: ${{ inputs.ghToken != '' }}
45+
env:
46+
GH_TOKEN: ${{ inputs.ghToken }}
47+
run: echo "${{ env.GH_TOKEN }}" | uds zarf tools registry login -u "dummy" --password-stdin ghcr.io
48+
shell: bash

.github/workflows/publish.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ jobs:
2525

2626
- name: Environment setup
2727
uses: ./.github/actions/setup
28-
29-
- name: Login to GHCR
30-
run: uds run registry-login --set REGISTRY=ghcr.io --set REGISTRY_USERNAME=dummy --set REGISTRY_PASSWORD=${{ secrets.GITHUB_TOKEN }} --set REGISTRY_RETRY_INTERVAL=90 --no-progress
31-
32-
- name: Login to registry1
33-
run: uds run registry-login --set REGISTRY=registry1.dso.mil --set REGISTRY_USERNAME=${{ secrets.IRON_BANK_ROBOT_USERNAME }} --set REGISTRY_PASSWORD=${{ secrets.IRON_BANK_ROBOT_PASSWORD }} --set REGISTRY_RETRY_INTERVAL=90 --no-progress
28+
with:
29+
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
30+
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
31+
ghToken: ${{ secrets.GITHUB_TOKEN }}
3432

3533
- name: (Snapshot) Get snapshot version using git commit short sha and date
3634
if: ${{ inputs.snapshot }}

.github/workflows/test.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@ jobs:
4949

5050
- name: Environment setup
5151
uses: ./.github/actions/setup
52-
53-
- name: Login to GHCR
54-
run: uds run registry-login --set REGISTRY=ghcr.io --set REGISTRY_USERNAME=dummy --set REGISTRY_PASSWORD=${{ secrets.GITHUB_TOKEN }} --set REGISTRY_RETRY_INTERVAL=90 --no-progress
55-
56-
- name: Login to registry1
57-
run: uds run registry-login --set REGISTRY=registry1.dso.mil --set REGISTRY_USERNAME=${{ secrets.IRON_BANK_ROBOT_USERNAME }} --set REGISTRY_PASSWORD=${{ secrets.IRON_BANK_ROBOT_PASSWORD }} --set REGISTRY_RETRY_INTERVAL=90 --no-progress
52+
with:
53+
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
54+
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
55+
ghToken: ${{ secrets.GITHUB_TOKEN }}
5856

5957
- name: Test a single source package
6058
if: ${{ inputs.package != 'all' && inputs.test_type == 'install' }}

tasks.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ includes:
1313
- deploy: ./tasks/deploy.yaml
1414
- test: ./tasks/test.yaml
1515
- lint: ./tasks/lint.yaml
16-
- common-setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.3.6/tasks/setup.yaml
1716

1817
tasks:
1918

@@ -61,15 +60,6 @@ tasks:
6160
actions:
6261
- task: setup:k3d-test-cluster
6362

64-
- name: registry-login
65-
actions:
66-
- task: common-setup:registry-login
67-
with:
68-
registry: ${REGISTRY}
69-
registryUsername: ${REGISTRY_USERNAME}
70-
registryPassword: ${REGISTRY_PASSWORD}
71-
registryRetryInterval: ${REGISTRY_RETRY_INTERVAL}
72-
7363
- name: create-single-package
7464
actions:
7565
- task: create:single-package

0 commit comments

Comments
 (0)