Fix Gitea mirror by skipping GitHub pull refs
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Push only refs/heads and refs/tags so Gitea no longer rejects refs/pull/* with "hook declined" and fails the mirror job. Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
This commit is contained in:
12
.github/workflows/mirror-to-gitea.yml
vendored
12
.github/workflows/mirror-to-gitea.yml
vendored
@@ -34,9 +34,9 @@ jobs:
|
|||||||
mirror.git
|
mirror.git
|
||||||
cd mirror.git
|
cd mirror.git
|
||||||
|
|
||||||
# Drop GitHub pull-request refs; Gitea should only get branches/tags.
|
# Push only branches/tags. Never push GitHub refs/pull/* — Gitea
|
||||||
git for-each-ref --format='%(refname)' 'refs/pull' \
|
# rejects those with "hook declined" and fails the whole mirror.
|
||||||
| while read -r ref; do git update-ref -d "$ref"; done
|
git push --prune \
|
||||||
|
"https://rhino:${GITEA_TOKEN}@git.faryad.top/rhino/xlsx-clean.git" \
|
||||||
git push --mirror \
|
"+refs/heads/*:refs/heads/*" \
|
||||||
"https://rhino:${GITEA_TOKEN}@git.faryad.top/rhino/xlsx-clean.git"
|
"+refs/tags/*:refs/tags/*"
|
||||||
|
|||||||
Reference in New Issue
Block a user