From dbd5a76f82016857b182026b05235b3b49f4a26b Mon Sep 17 00:00:00 2001 From: f-trycua Date: Tue, 18 Nov 2025 23:47:35 +0100 Subject: [PATCH] Ensure workflows fetch absolute latest main after version bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add explicit git fetch and reset after checkout to guarantee workflows get the most recent main branch commits, including version bumps pushed by the bump-version workflow. The issue: When using workflow_call, even with ref: main, GitHub Actions may use a cached repository state from workflow run start. This caused version consistency checks to fail because the checkout didn't include the just-pushed version bump. Solution: After checkout, explicitly fetch and reset to origin/main to ensure we have the absolute latest code. Added logging to show the current commit for debugging. Fixes: https://github.com/trycua/cua/actions/runs/19482970320 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/pypi-publish-agent.yml | 8 ++++++++ .github/workflows/pypi-reusable-publish.yml | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/pypi-publish-agent.yml b/.github/workflows/pypi-publish-agent.yml index f20cf2fb..25d7ac41 100644 --- a/.github/workflows/pypi-publish-agent.yml +++ b/.github/workflows/pypi-publish-agent.yml @@ -33,6 +33,14 @@ jobs: - uses: actions/checkout@v4 with: ref: main + fetch-depth: 0 + + - name: Ensure latest main branch + run: | + git fetch origin main + git reset --hard origin/main + echo "Current HEAD commit:" + git log -1 --oneline - name: Determine version id: get-version diff --git a/.github/workflows/pypi-reusable-publish.yml b/.github/workflows/pypi-reusable-publish.yml index 9be38105..71262391 100644 --- a/.github/workflows/pypi-reusable-publish.yml +++ b/.github/workflows/pypi-reusable-publish.yml @@ -50,6 +50,13 @@ jobs: ref: main fetch-depth: 0 # Full history for release creation + - name: Ensure latest main branch + run: | + git fetch origin main + git reset --hard origin/main + echo "Current HEAD commit:" + git log -1 --oneline + - name: Set up Python uses: actions/setup-python@v4 with: