commit
Delete .github/workflows/codeberg.yml
diff --git a/.github/workflows/codeberg.yml b/.github/workflows/codeberg.yml
deleted file mode 100644
index 3dcc9c9..0000000
--- a/.github/workflows/codeberg.yml
+++ /dev/null
@@ -1,68 +0,0 @@
-# go to my backup
-name: Codeberg
-
-on:
- push:
-
-jobs:
- mirror:
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
-
- concurrency:
- group: mirror-${{ github.repository }}
- cancel-in-progress: false
-
- env:
- CODEBERG_HOST: codeberg.org
- CODEBERG_USERNAME: ${{ secrets.CODEBERG_USERNAME }}
- CODEBERG_REPO: ${{ secrets.CODEBERG_REPO }}
- CODEBERG_TOKEN: ${{ secrets.CODEBERG_TOKEN }}
-
- steps:
- - name: Clone every ref
- env:
- SOURCE_TOKEN: ${{ github.token }}
- SERVER_URL: ${{ github.server_url }}
- run: |
- set -euo pipefail
-
- sourceHost="${SERVER_URL#https://}"
-
- git clone --mirror \
- "https://x-access-token:${SOURCE_TOKEN}@${sourceHost}/${GITHUB_REPOSITORY}.git" \
- source.git
-
- - name: Push mirror
- working-directory: source.git
- run: |
- set -euo pipefail
-
- if [ -z "$CODEBERG_USERNAME" ]; then
- echo "CODEBERG_USERNAME is not set" >&2
- exit 1
- fi
-
- if [ -z "$CODEBERG_REPO" ]; then
- echo "CODEBERG_REPO is not set" >&2
- exit 1
- fi
-
- targetUrl="https://${CODEBERG_HOST}/${CODEBERG_USERNAME}/${CODEBERG_REPO}.git"
-
- echo "Mirroring ${GITHUB_REPOSITORY} -> ${targetUrl}"
-
- git remote add mirror "$targetUrl"
-
- # GitHub's synthetic refs/pull/* refs live in a hidden namespace on
- # Codeberg/Gitea and are always rejected, so drop them before mirroring.
- for ref in $(git for-each-ref --format='%(refname)' 'refs/pull/*/head' 'refs/pull/*/merge'); do
- git update-ref -d "$ref"
- done
-
- # Credentials go through a helper so the token never lands in .git/config
- git -c credential.helper= \
- -c "credential.helper=!f() { echo username=\"\$CODEBERG_USERNAME\"; echo password=\"\$CODEBERG_TOKEN\"; }; f" \
- push --mirror mirror