From 91717061261f49d63d48d5b37d71cc995811e9f1 Mon Sep 17 00:00:00 2001 From: UnicornChance Date: Wed, 29 May 2024 09:18:21 -0600 Subject: [PATCH 1/4] fix: remove deprecated registry login and add env setup --- .github/workflows/publish.yaml | 10 ++++------ .github/workflows/test.yaml | 10 ++++------ tasks.yaml | 9 --------- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 52e73ad96..a78140303 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -25,12 +25,10 @@ jobs: - name: Environment setup uses: ./.github/actions/setup - - - name: Login to GHCR - 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 - - - name: Login to registry1 - 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 + with: + registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} + ghToken: ${{ secrets.GITHUB_TOKEN }} - name: (Snapshot) Get snapshot version using git commit short sha and date if: ${{ inputs.snapshot }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bc1b01ebb..740bc8b26 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -49,12 +49,10 @@ jobs: - name: Environment setup uses: ./.github/actions/setup - - - name: Login to GHCR - 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 - - - name: Login to registry1 - 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 + with: + registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} + ghToken: ${{ secrets.GITHUB_TOKEN }} - name: Test a single source package if: ${{ inputs.package != 'all' && inputs.test_type == 'install' }} diff --git a/tasks.yaml b/tasks.yaml index 58bd078f8..253df53c0 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -61,15 +61,6 @@ tasks: actions: - task: setup:k3d-test-cluster - - name: registry-login - actions: - - task: common-setup:registry-login - with: - registry: ${REGISTRY} - registryUsername: ${REGISTRY_USERNAME} - registryPassword: ${REGISTRY_PASSWORD} - registryRetryInterval: ${REGISTRY_RETRY_INTERVAL} - - name: create-single-package actions: - task: create:single-package From 77c1c9ad5beb65e2b3df9c2cf1fd4638218076fe Mon Sep 17 00:00:00 2001 From: UnicornChance Date: Wed, 29 May 2024 09:21:24 -0600 Subject: [PATCH 2/4] fix: remove misc includes task from uds-common --- tasks.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks.yaml b/tasks.yaml index 253df53c0..4c166497b 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -13,7 +13,6 @@ includes: - deploy: ./tasks/deploy.yaml - test: ./tasks/test.yaml - lint: ./tasks/lint.yaml - - common-setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.3.6/tasks/setup.yaml tasks: From 1f222ab47c6a876309db3a7b33fa6e1a6bc4ed35 Mon Sep 17 00:00:00 2001 From: UnicornChance Date: Wed, 29 May 2024 09:32:58 -0600 Subject: [PATCH 3/4] fix: add registry login to setup --- .github/actions/setup/action.yaml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 141f57fab..405b15b2e 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -2,13 +2,13 @@ name: "Setup Environment" description: "UDS Environment Setup" inputs: - gh_token: + ghToken: description: 'GITHUB_TOKEN' required: true - ib_user: + registry1Username: description: 'IRON_BANK_ROBOT_USERNAME' required: true - ib_password: + registry1Password: description: 'IRON_BANK_ROBOT_PASSWORD' required: true @@ -31,3 +31,18 @@ runs: shell: bash # renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver run: brew install defenseunicorns/tap/uds@0.10.4 + + - 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: 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 \ No newline at end of file From c88a5adcfbe2cd330154c13798b2c0d08497bc9a Mon Sep 17 00:00:00 2001 From: UnicornChance Date: Wed, 29 May 2024 10:21:41 -0600 Subject: [PATCH 4/4] fix: lint check --- .github/actions/setup/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 405b15b2e..eb9b6cb7c 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -45,4 +45,4 @@ runs: env: GH_TOKEN: ${{ inputs.ghToken }} run: echo "${{ env.GH_TOKEN }}" | uds zarf tools registry login -u "dummy" --password-stdin ghcr.io - shell: bash \ No newline at end of file + shell: bash