Update .gitea/workflows/mirror.yml
This commit is contained in:
1 parent
867cc17ebf
commit
344ba12f7a
1 file changed
+14
-10
+14
-10
@@ -10,17 +10,21 @@ jobs:
|
||||
mirror:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Push repository to GitHub
|
||||
- name: Check out Gitea repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Push main to GitHub
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
run: |
|
||||
set -eu
|
||||
git clone --bare \
|
||||
https://oauth2:${GH_TOKEN}@github.com/tafakkur/PyNix-Website.git \
|
||||
mirror.git
|
||||
cd mirror.git
|
||||
git fetch --prune \
|
||||
https://oauth2:${GH_TOKEN}@github.com/tafakkur/PyNix-Website.git \
|
||||
'+refs/heads/*:refs/heads/*'
|
||||
git push --mirror \
|
||||
https://oauth2:${GH_TOKEN}@github.com/tafakkur/PyNix-Website.git
|
||||
|
||||
AUTH="$(printf 'x-access-token:%s' "$GH_TOKEN" | base64 | tr -d '\n')"
|
||||
|
||||
git remote add github \
|
||||
https://github.com/tafakkur/PyNix-Website.git
|
||||
|
||||
git -c http.extraheader="AUTHORIZATION: basic $AUTH" \
|
||||
push --force github HEAD:refs/heads/main
|
||||
Reference in new issue
Block a user