fix(release): sanitize package name in stage_npm_packages.py for temp directory creation
The script was failing when creating temporary directories for scoped packages like @valknar/llmx because the forward slash in the package name was being used directly in the temp directory prefix, causing Python's tempfile.mkdtemp() to fail with 'No such file or directory'. Fix by sanitizing the package name: replace '/' with '-' and remove '@' before using it in the temp directory prefix. The actual package output file still uses the original package name. Fixes: FileNotFoundError in GitHub Actions rust-release workflow
This commit is contained in:
@@ -148,7 +148,9 @@ def main() -> int:
|
||||
print(f"should `git checkout {resolved_head_sha}`")
|
||||
|
||||
for package in packages:
|
||||
staging_dir = Path(tempfile.mkdtemp(prefix=f"npm-stage-{package}-", dir=runner_temp))
|
||||
# Sanitize package name for use in filesystem path (replace / with -)
|
||||
safe_package_name = package.replace("/", "-").replace("@", "")
|
||||
staging_dir = Path(tempfile.mkdtemp(prefix=f"npm-stage-{safe_package_name}-", dir=runner_temp))
|
||||
pack_output = output_dir / f"{package}-npm-{args.release_version}.tgz"
|
||||
|
||||
cmd = [
|
||||
|
||||
Reference in New Issue
Block a user