From 7f6940b8ba8098c74b799386af7424076ca48d41 Mon Sep 17 00:00:00 2001 From: Kochetkov S Date: Tue, 11 Aug 2026 14:56:52 +0300 Subject: [PATCH] ++ fix stale checkout skip, compare to GITHUB_SHA not just file presence --- .gitea/workflows/terraform.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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