diff --git a/action.yml b/action.yml index 85ca823..41cb649 100644 --- a/action.yml +++ b/action.yml @@ -50,6 +50,8 @@ runs: pkgbase='${{inputs.pkgbase}}' [ -n "$pkgbase" ] || pkgbase="$( (. PKGBUILD && printf '%s' "$pkgbase") )" [ -n "$pkgbase" ] || pkgbase="$( (. PKGBUILD && printf '%s' "$pkgname") )" + [ -n "$pkgver" ] || pkgver="$( (. PKGBUILD && printf '%s' "$pkgver") )" + [ -n "$pkgrel" ] || pkgver="$( (. PKGBUILD && printf '%s' "$pkgrel") )" [ -n "$pkgbase" ] || \ ( echo "Failed to determine pkgbase"; exit 1 ) @@ -57,5 +59,14 @@ runs: ( echo "Git ref is neither main nor master, aborting"; exit 1 ) || exit 0 export GIT_SSH_COMMAND='ssh -i ~/.ssh/ssh_key -o IdentitiesOnly=yes' - git remote add aur "ssh://aur@aur.archlinux.org/$pkgbase.git" - git push aur "${{github.ref_name}}:master" + 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) + cd aur + git add . + git config user.name "${{github.event.head_commit.committer.name}}" + git config user.email "${{github.event.head_commit.committer.email}}" + git commit -m "$pkgbase $pkgver-$pkgrel (${{github.event.head_commit.url}})" \ + --author "${{github.event.head_commit.author.name}} <${{github.event.head_commit.author.email}}>" + git show HEAD + echo git push aur "${{github.ref_name}}:master"