This commit is contained in:
NianBroken
2024-02-14 15:18:01 +08:00 Unverified
parent 50a70c3b28
commit e1d260a908
+14 -11
View File
@@ -18,6 +18,7 @@ on:
jobs: jobs:
SyncFork: SyncFork:
name: SyncFork
# 在最新版的Ubuntu系统上运行 # 在最新版的Ubuntu系统上运行
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -41,6 +42,17 @@ jobs:
git remote add upstream "$REPO_URL" git remote add upstream "$REPO_URL"
git fetch upstream main git fetch upstream main
# 对比当前分支的main.yml文件与上游分支的main.yml文件是否一致
- name: Compare main.yml files
run: |
if cmp -s .github/workflows/main.yml <(git show upstream/main:.github/workflows/main.yml); then
echo "main.yml file is consistent"
echo "MAIN_YML_FILES_INCONSISTENT=False" >> $GITHUB_ENV
else
echo "main.yml file is inconsistent"
echo "MAIN_YML_FILES_INCONSISTENT=True" >> $GITHUB_ENV
fi
# 定义备份和还原的文件后缀列表 # 定义备份和还原的文件后缀列表
- name: Set file extensions - name: Set file extensions
run: | run: |
@@ -77,6 +89,8 @@ jobs:
git push origin main --force git push origin main --force
CheckScores: CheckScores:
name: CheckScores
needs: SyncFork
# 在最新版的Ubuntu系统上运行 # 在最新版的Ubuntu系统上运行
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -100,17 +114,6 @@ jobs:
git config --global user.email "actions@github.com" git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions" git config --global user.name "GitHub Actions"
# 对比当前分支的main.yml文件与上游分支的main.yml文件是否一致
- name: Compare main.yml files
run: |
if cmp -s .github/workflows/main.yml <(git show upstream/main:.github/workflows/main.yml); then
echo "main.yml file is consistent"
echo "MAIN_YML_FILES_INCONSISTENT=False" >> $GITHUB_ENV
else
echo "main.yml file is inconsistent"
echo "MAIN_YML_FILES_INCONSISTENT=True" >> $GITHUB_ENV
fi
# 运行主程序main.py # 运行主程序main.py
- name: Run main.py - name: Run main.py
env: env: