From 5439b91c7b0ed1d75c7a5ec3f2b3f4e94ea5968a Mon Sep 17 00:00:00 2001 From: Jennifer Power Date: Wed, 4 Sep 2024 16:03:39 -0400 Subject: [PATCH] fix: updates e2e tests checkout ref during image publishing (#334) When rebuilding old images, we need to run the E2E from that references to avoid issues with breaking changes in the CLI. Signed-off-by: Jennifer Power --- .github/actions/publish-image/action.yml | 7 ++----- .github/workflows/publish.yml | 12 ++++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/actions/publish-image/action.yml b/.github/actions/publish-image/action.yml index 792c1323..1af449fb 100644 --- a/.github/actions/publish-image/action.yml +++ b/.github/actions/publish-image/action.yml @@ -8,9 +8,6 @@ inputs: release_version: required: true description: The version to build type semver tags from - git_ref: - required: true - description: The git reference to build image from no_cache: description: Skip using cache when building the image. required: false @@ -52,7 +49,7 @@ runs: uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # pin@v5 id: build-and-export with: - context: "${{ github.server_url }}/${{ github.repository }}.git#${{ inputs.git_ref }}" + context: "." load: true no-cache: ${{ inputs.no_cache == 'true' }} cache-from: type=gha @@ -81,7 +78,7 @@ runs: uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # pin@v5 id: build-and-push with: - context: "${{ github.server_url }}/${{ github.repository }}.git#${{ inputs.git_ref }}" + context: "." push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e90bb067..aaf810ec 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -46,11 +46,6 @@ jobs: password: ${{ secrets.QUAY_TOKEN }} registry: ${{ env.IMAGE_REGISTRY }} - - name: Check out - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 - with: - persist-credentials: false - - name: Set up cosign uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # pin@v3.5.0 @@ -97,6 +92,12 @@ jobs: } >> "$GITHUB_ENV" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Check out + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 + with: + ref: ${{ env.BUILD_GIT_REF }} + persist-credentials: false - name: Build and Publish the image uses: ./.github/actions/publish-image @@ -105,7 +106,6 @@ jobs: image: ${{ env.IMAGE_REGISTRY }}/${{ vars.QUAY_ORG }}/${{ env.IMAGE_NAME }} release_version: ${{ env.TAG }} no_cache: ${{ env.NO_CACHE }} - git_ref: ${{ env.BUILD_GIT_REF }} skip_tests: ${{ env.SKIP_TESTS }} - name: Sign the image with GitHub OIDC Token