diff --git a/.gitea/workflows/terraform.yml b/.gitea/workflows/terraform.yml index 8d02788..a041aa2 100644 --- a/.gitea/workflows/terraform.yml +++ b/.gitea/workflows/terraform.yml @@ -70,8 +70,8 @@ jobs: steps: - name: Checkout (without Node.js action) run: | - if [ -f infrastructure.yaml ] && [ -d live ]; then - echo "Workspace already contains repository files, skip checkout." + if [ -f infrastructure.yaml ] && [ -d live ] && [ "$(git rev-parse HEAD 2>/dev/null)" = "${GITHUB_SHA}" ]; then + echo "Workspace already at ${GITHUB_SHA}, skip checkout." exit 0 fi @@ -139,8 +139,8 @@ jobs: steps: - name: Checkout (without Node.js action) run: | - if [ -f infrastructure.yaml ] && [ -d live ]; then - echo "Workspace already contains repository files, skip checkout." + if [ -f infrastructure.yaml ] && [ -d live ] && [ "$(git rev-parse HEAD 2>/dev/null)" = "${GITHUB_SHA}" ]; then + echo "Workspace already at ${GITHUB_SHA}, skip checkout." exit 0 fi @@ -207,8 +207,8 @@ jobs: steps: - name: Checkout (without Node.js action) run: | - if [ -f infrastructure.yaml ] && [ -d live ]; then - echo "Workspace already contains repository files, skip checkout." + if [ -f infrastructure.yaml ] && [ -d live ] && [ "$(git rev-parse HEAD 2>/dev/null)" = "${GITHUB_SHA}" ]; then + echo "Workspace already at ${GITHUB_SHA}, skip checkout." exit 0 fi