From e0d2f3f840e8c1c285210d1a604ea8617bd65ac4 Mon Sep 17 00:00:00 2001 From: Matthew Kenigsberg Date: Tue, 19 Nov 2024 11:01:20 -0700 Subject: [PATCH] Fix git issue with prerelease job Currently the prerelease job fails with: ``` error: The following untracked working tree files would be overwritten by checkout: nix-installer-aarch64-darwin nix-installer-aarch64-linux nix-installer-i686-linux nix-installer-x86_64-darwin nix-installer-x86_64-linux ``` https://github.com/NixOS/experimental-nix-installer/actions/runs/11708583897/job/32610685871 This is because assemble_installer.py adds those files on main, but then the job tries to checkout prerelease. Instead, fetch and checkout the prerelease branch in assemble_installer.py before creating those files. --- .github/workflows/release-script.yml | 5 ++++- assemble_installer.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-script.yml b/.github/workflows/release-script.yml index cd79c9b68..09c80778b 100644 --- a/.github/workflows/release-script.yml +++ b/.github/workflows/release-script.yml @@ -17,4 +17,7 @@ jobs: with: commit_message: "Update installer script" commit_user_name: "GitHub Actions" - branch: prerelease \ No newline at end of file + branch: prerelease + # assemble_installer.py already does a fetch and checkout + skip_fetch: true + skip_checkout: true diff --git a/assemble_installer.py b/assemble_installer.py index ff9d40b9d..dd3cb4939 100644 --- a/assemble_installer.py +++ b/assemble_installer.py @@ -24,5 +24,8 @@ else: sys.exit(0) +subprocess.run("git fetch origin prerelease", check=True) +subprocess.run("git checkout prerelease", check=True) + for installer_url, system in installers: shutil.copy(f"{installer_url}/bin/nix-installer", f"nix-installer-{system}")