diff --git a/.github/workflows/base-deploy.yml b/.github/workflows/base-deploy.yml index fc56410aa..7403d3abb 100644 --- a/.github/workflows/base-deploy.yml +++ b/.github/workflows/base-deploy.yml @@ -81,15 +81,10 @@ jobs: - name: "Resolve the dev-* tag for this commit" id: tag run: | - git fetch --tags --force - SHA="${{ github.event.workflow_run.head_sha }}" - TAG=$(git tag --points-at "$SHA" | grep '^dev-' | head -n1 || true) - if [ -z "$TAG" ]; then - echo "Using the dev tag provided in the input field" >&2 - TAG="${{ inputs.ref }}" - fi - echo "name=$TAG" >> $GITHUB_OUTPUT - echo "Resolved tag: $TAG" + # Get the full SHA from the triggering run + FULL_SHA="${{ github.event.workflow_run.head_sha }}" + echo "name=dev-$FULL_SHA" >> $GITHUB_OUTPUT + echo "Resolved version name: dev-$FULL_SHA" - name: "Resolve promoted environment" id: promoted_env diff --git a/.github/workflows/cicd-2-publish.yaml b/.github/workflows/cicd-2-publish.yaml index f3f0ad688..04ed5ed9f 100644 --- a/.github/workflows/cicd-2-publish.yaml +++ b/.github/workflows/cicd-2-publish.yaml @@ -9,6 +9,7 @@ on: branches: - main - hotfix/* + - fix/workflow-dev-tag-issue workflow_dispatch: {} concurrency: @@ -44,7 +45,8 @@ jobs: echo "nodejs_version=$(grep "^nodejs" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT echo "python_version=$(grep "^nodejs" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT echo "terraform_version=$(grep "^terraform" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT - echo "version=dev-$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT + FULL_SHA="${{ github.sha }}" + echo "version=dev-$FULL_SHA" >> $GITHUB_OUTPUT - name: "List variables" run: | diff --git a/.github/workflows/cicd-3-test-deploy.yaml b/.github/workflows/cicd-3-test-deploy.yaml index cbff54241..305e80e9e 100644 --- a/.github/workflows/cicd-3-test-deploy.yaml +++ b/.github/workflows/cicd-3-test-deploy.yaml @@ -33,18 +33,13 @@ jobs: run: | echo "terraform_version=$(grep '^terraform' .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT - - name: "Resolve the dev-* tag for this commit" + - name: "Resolve version from SHA" id: tag run: | - git fetch --tags --force - SHA="${{ github.event.workflow_run.head_sha }}" - TAG=$(git tag --points-at "$SHA" | grep '^dev-' | head -n1 || true) - if [ -z "$TAG" ]; then - echo "No dev-* tag found on $SHA" >&2 - exit 1 - fi - echo "name=$TAG" >> $GITHUB_OUTPUT - echo "Resolved tag: $TAG" + # Get the full SHA from the triggering run + FULL_SHA="${{ github.event.workflow_run.head_sha }}" + echo "name=dev-$FULL_SHA" >> $GITHUB_OUTPUT + echo "Resolved version name: dev-$FULL_SHA" deploy: name: "Deploy to TEST (approval required)"