try it
This commit is contained in:
parent
2d42f39610
commit
90bb5ba1c9
17
.github/workflows/mirror.yml
vendored
17
.github/workflows/mirror.yml
vendored
@ -3,8 +3,7 @@ on:
|
|||||||
- cron: "0,20,40 * * * *"
|
- cron: "0,20,40 * * * *"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions: write-all
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pull_remote:
|
pull_remote:
|
||||||
@ -13,6 +12,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: just checkout
|
- name: just checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.WORK_TOKEN }}
|
||||||
|
|
||||||
- name: clone remote
|
- name: clone remote
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -21,14 +22,4 @@ jobs:
|
|||||||
git config --global user.name shenjack-action
|
git config --global user.name shenjack-action
|
||||||
git remote add gitea http://shenjack.top:5100/ARS/ars-tools.git
|
git remote add gitea http://shenjack.top:5100/ARS/ars-tools.git
|
||||||
git fetch gitea
|
git fetch gitea
|
||||||
for branch in $(git branch -r | grep 'gitea'); do
|
git push origin --mirror
|
||||||
branchName=${branch#*/}
|
|
||||||
if ! git branch | grep -q $branchName; then
|
|
||||||
git branch --track $branchName $branch
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: push to github
|
|
||||||
run: |
|
|
||||||
git pull --all
|
|
||||||
git push origin --all --force
|
|
||||||
|
Loading…
Reference in New Issue
Block a user