From ee1b5dbe8495784efe32402c7eeaac51f1b1eacc Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Sat, 4 Oct 2025 01:14:01 +0000 Subject: [PATCH] ci: fix github push workflow Change-Id: rkptvmqpotvrkuorlrmoxpvzkoolorvn There were various problems with it before - it was only really half-modified from the tangled.yml workflow we had over on GitHub! It now works and has been tested to put up a branch with a test push --- .tangled/workflows/github.yml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.tangled/workflows/github.yml b/.tangled/workflows/github.yml index a438a5be..c9b6b6ce 100644 --- a/.tangled/workflows/github.yml +++ b/.tangled/workflows/github.yml @@ -4,19 +4,35 @@ when: - event: ["push"] - branch: ["release"] + branch: ["release", "test"] engine: nixery +dependencies: + nixpkgs: + - git + - openssh + steps: - name: Write SSH Key command: | - echo $GITHUB_SSH_KEY > ssh_key - chmod 600 ssh_key + echo "$KEY_SSH_GITHUB" > /tmp/key-ssh-github + chmod 600 /tmp/key-ssh-github + - name: Add base system files + command: | + # Avoid missing user with UID 0 error on ssh... + echo "root:x:0:0:System administrator:/root:/run/current-system/sw/bin/bash" >> /etc/passwd + + # Turn off SSH host key checking + echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config + echo "UserKnownHostsFile /dev/null" >> /etc/ssh/ssh_config + + echo "Host github.com" >> /etc/ssh/ssh_config + echo " User git" >> /etc/ssh/ssh_config + echo " IdentityFile /tmp/key-ssh-github" >> /etc/ssh/ssh_config - name: Push to GitHub command: | - export GIT_SSH_COMMAND="ssh -i $(realpath ./ssh_key) -o StrictHostKeyChecking=no" - git remote add github git@github.com:freshlybakedca.ke/Patisserie + git remote add github git@github.com:FreshlyBakedCake/Patisserie.git git fetch --unshallow origin git fetch github - git push tangled HEAD + git push github HEAD:refs/heads/release -- 2.43.0