From 81a3efd0332096e9954d9aa0201cb313e931aa44 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 9 Dec 2024 15:34:11 +0100 Subject: [PATCH] actually, I'd rather not copy files not tracked by git --- action.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 6ffb33a..7adcdde 100644 --- a/action.yml +++ b/action.yml @@ -37,8 +37,6 @@ runs: - name: Ensure .SRCINFO is up to date run: diff -u .SRCINFO .SRCINFO.new - - run: rm .SRCINFO.new - - name: Mirror to the AUR run: | mkdir -p ~/.ssh @@ -62,8 +60,21 @@ runs: export GIT_SSH_COMMAND='ssh -i ~/.ssh/ssh_key -o IdentitiesOnly=yes' git clone "ssh://aur@aur.archlinux.org/$pkgbase.git" aur - find aur -maxdepth 1 -type f | (set -x; while read file; do rm -f "$file"; done) - find . -maxdepth 1 -type f | (set -x; while read file; do cp "$file" aur; done) + find aur -maxdepth 1 -type f \ + | while read file + do + echo "Removing old file $file ..." + rm -f "$file" + done + git ls-tree --name-only HEAD \ + | while read file + do + if [ -f "$file" ] + then + echo "Copying new file $file ..." + cp "$file" aur + fi + done cd aur git add . git config user.name "${{github.event.head_commit.committer.name}}"