2023-12-16 16:12:19 +08:00
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0,20,40 * * * *"
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
pull_remote:
|
|
|
|
name: mirror shenjack.top
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: just checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: clone remote
|
2023-12-16 16:31:23 +08:00
|
|
|
shell: bash
|
2023-12-16 16:12:19 +08:00
|
|
|
run: |
|
|
|
|
git config --global user.email 3695888@qq.com
|
|
|
|
git config --global user.name shenjack-action
|
|
|
|
git remote add gitea http://shenjack.top:5100/ARS/ars-tools.git
|
|
|
|
git fetch gitea
|
2023-12-16 16:31:23 +08:00
|
|
|
for branch in $(git branch -r | grep 'gitea'); do
|
|
|
|
branchName=${branch#*/}
|
|
|
|
if ! git branch | grep -q $branchName; then
|
|
|
|
git branch --track $branchName $branch
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
- name: push to github
|
|
|
|
run: |
|
2023-12-16 16:25:21 +08:00
|
|
|
git pull --all
|
2023-12-16 16:28:03 +08:00
|
|
|
git push origin --all --force
|