From 2fbcf26fbae486d072d04b285712052d4cad7f21 Mon Sep 17 00:00:00 2001 From: yuanzhen869 Date: Sat, 9 Nov 2024 06:57:10 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/sync=5Fra?= =?UTF-8?q?w=5Ffile.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/sync_raw_file.yml | 27 +++++++++++++++++++++++++++ .gitea/workflows/sync_repo.yml | 29 ----------------------------- 2 files changed, 27 insertions(+), 29 deletions(-) create mode 100644 .gitea/workflows/sync_raw_file.yml delete mode 100644 .gitea/workflows/sync_repo.yml diff --git a/.gitea/workflows/sync_raw_file.yml b/.gitea/workflows/sync_raw_file.yml new file mode 100644 index 0000000..d976a4a --- /dev/null +++ b/.gitea/workflows/sync_raw_file.yml @@ -0,0 +1,27 @@ +name: SyncRawFile +on: + push: + paths: + - .gitea/workflows/sync_raw_file.yml # 仅在该文件被修改时触发 + schedule: + - cron: "0 * * * *" # 每小时执行一次 + +jobs: + sync_files: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Download raw file from GitHub + run: | + mkdir -p ./loon/ + curl -o ./loon/China_All.list https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Surge/China/China_All.list + + - name: Commit and push changes + run: | + git config --global user.name "yuanzhen869" + git config --global user.email "yuanzhen869@gmail.com" + git add . + git commit -m "Sync file from GitHub raw" || echo "No changes to commit" + git push origin main \ No newline at end of file diff --git a/.gitea/workflows/sync_repo.yml b/.gitea/workflows/sync_repo.yml deleted file mode 100644 index e592300..0000000 --- a/.gitea/workflows/sync_repo.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: SyncEntireRepo -on: - push: - paths: - - .gitea/workflows/sync_repo.yml # 仅在该文件被修改时触发 - schedule: - - cron: "0 * * * *" # 每小时执行一次 - -jobs: - sync_repo: - runs-on: ubuntu-latest - steps: - - name: Configure Git - run: | - git config --global user.name "yuanzhen869" - git config --global user.email "yuanzhen869@gmail.com" - - - name: Clone GitHub repository - run: | - git clone --mirror https://github.com/blackmatrix7/ios_rule_script.git repo_sync # 替换为GitHub仓库URL - cd repo_sync - git remote add gitea https://git.halonice.com/yuanzhen869/bypass.git # 替换为Gitea仓库URL - git fetch -p origin - git push -f gitea --all # 推送所有分支 - git push -f gitea --tags # 推送所有标签 - - - name: Clean up - run: | - rm -rf repo_sync \ No newline at end of file