Fix Forgejo workflows for the actual server capabilities

- package.yml: correct Arch registry upload (octet-stream + binary body),
  drop --privileged, manual shell clone (archlinux image has no Node),
  built-in Actions token, --nocheck
- mirror.yml: clone --mirror + explicit refs push with --prune

Requires only the GITHUB_MIRROR_TOKEN secret for the mirror job.
This commit is contained in:
Breadway 2026-06-13 16:01:58 +08:00
parent 4446b5e98b
commit c70c9a7278
2 changed files with 30 additions and 35 deletions

View file

@ -9,12 +9,13 @@ jobs:
mirror:
runs-on: [self-hosted, hestia]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push to GitHub
- name: Mirror to GitHub
run: |
git remote add github \
"https://x-access-token:${{ secrets.GITHUB_MIRROR_TOKEN }}@github.com/Breadway/bread.git"
git push github --mirror
set -euo pipefail
git clone --mirror "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" repo.git
cd repo.git
# Mirror only branches and tags (not refs/pull/*, which GitHub rejects);
# --prune deletes GitHub refs that no longer exist on Forgejo.
git push --prune \
"https://x-access-token:${{ secrets.GITHUB_MIRROR_TOKEN }}@github.com/Breadway/bread.git" \
'+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*'