From 246a9b598c98217e48947822dcf44c351c373087 Mon Sep 17 00:00:00 2001 From: Amanuel Engeda <74629455+engedaam@users.noreply.github.com> Date: Thu, 14 Dec 2023 16:38:19 -0800 Subject: [PATCH] ci: Add `git_ref` for E2E test runs on Head (#5333) --- .github/actions/e2e/setup-cluster/action.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/actions/e2e/setup-cluster/action.yaml b/.github/actions/e2e/setup-cluster/action.yaml index 6d3965e0ad67..e5a9ec78426f 100644 --- a/.github/actions/e2e/setup-cluster/action.yaml +++ b/.github/actions/e2e/setup-cluster/action.yaml @@ -82,6 +82,9 @@ runs: PRIVATE_CLUSTER: ${{ inputs.private_cluster }} GIT_REF: ${{ inputs.git_ref }} run: | + if [[ "$GIT_REF" == '' ]]; then + GIT_REF=$(git rev-parse HEAD) + fi # Create or Upgrade the cluster based on whether the cluster already exists cmd="create" eksctl get cluster --name "$CLUSTER_NAME" && cmd="upgrade" @@ -188,8 +191,11 @@ runs: env: ACCOUNT_ID: ${{ inputs.account_id }} CLUSTER_NAME: ${{ inputs.cluster_name }} - GIT_REF: ${{ inputs.git_ref }} + GIT_REF: ${{ inputs.git_ref }} run: | + if [[ "$GIT_REF" == '' ]]; then + GIT_REF=$(git rev-parse HEAD) + fi oidc_id=$(aws eks describe-cluster --name "$CLUSTER_NAME" --query "cluster.identity.oidc.issuer" --output text | cut -d '/' -f 3,4,5) arn="arn:aws:iam::$ACCOUNT_ID:oidc-provider/${oidc_id}" aws iam tag-open-id-connect-provider --open-id-connect-provider-arn $arn \