Skip to content

Commit 7097f71

Browse files
authored
Fix git issue with prerelease job (NixOS#22)
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.
1 parent 5335fd1 commit 7097f71

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/release-script.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ jobs:
1818
with:
1919
commit_message: "Update installer script"
2020
commit_user_name: "GitHub Actions"
21-
branch: prerelease
21+
branch: prerelease
22+
# assemble_installer.py already does a fetch and checkout
23+
skip_fetch: true
24+
skip_checkout: true

assemble_installer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@
2424
else:
2525
sys.exit(0)
2626

27+
subprocess.run(["git", "fetch", "origin", "prerelease"], check=True)
28+
subprocess.run(["git", "checkout", "-b", "prerelease", "origin/prerelease"], check=True)
29+
2730
for installer_url, system in installers:
2831
shutil.copy(f"{installer_url}/bin/nix-installer", f"nix-installer-{system}")

0 commit comments

Comments
 (0)