diff --git a/.github/workflows/mirror-to-gitea.yml b/.github/workflows/mirror-to-gitea.yml index 2a799f3..fa77af3 100644 --- a/.github/workflows/mirror-to-gitea.yml +++ b/.github/workflows/mirror-to-gitea.yml @@ -34,9 +34,9 @@ jobs: mirror.git cd mirror.git - # Drop GitHub pull-request refs; Gitea should only get branches/tags. - git for-each-ref --format='%(refname)' 'refs/pull' \ - | while read -r ref; do git update-ref -d "$ref"; done - - git push --mirror \ - "https://rhino:${GITEA_TOKEN}@git.faryad.top/rhino/xlsx-clean.git" + # Push only branches/tags. Never push GitHub refs/pull/* — Gitea + # rejects those with "hook declined" and fails the whole mirror. + git push --prune \ + "https://rhino:${GITEA_TOKEN}@git.faryad.top/rhino/xlsx-clean.git" \ + "+refs/heads/*:refs/heads/*" \ + "+refs/tags/*:refs/tags/*"