Fix virtual environment reuse error in multi-deployment jobs#72
Merged
jamiezieziula merged 1 commit intomainfrom Feb 6, 2026
Merged
Fix virtual environment reuse error in multi-deployment jobs#72jamiezieziula merged 1 commit intomainfrom
jamiezieziula merged 1 commit intomainfrom
Conversation
When this action runs multiple times in the same GitHub Actions job, subsequent runs fail with: error: Failed to create virtual environment Caused by: A virtual environment already exists at .venv This happens because uv venv refuses to overwrite an existing .venv directory without the --clear flag. Changes: - Add --clear flag to 'uv venv' command - Forces recreation of .venv if it already exists - Allows action to be called multiple times in same job safely Impact: - No breaking changes - action behavior is identical - Fixes intermittent failures when deploying multiple flows - Eliminates need for workarounds in consuming workflows Fixes: workflows failing with "A virtual environment already exists"
jimid27
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When this action runs multiple times in the same GitHub Actions job, subsequent runs fail with:
This causes intermittent failures when deploying multiple Prefect flows in the same workflow job.
Root Cause
The
uv venvcommand (line 55) creates a.venvdirectory but doesn't clean it up. When called a second time in the same job, it refuses to overwrite the existing directory without the--clearflag.This became an issue after v4.3.0 re-enabled uv for dependency management (PR #66).
Solution
Add
--clearflag touv venvcommand:Testing
Tested by running action multiple times in same job - second run now succeeds instead of failing.
Impact
Related