diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d187845..9f12923 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,7 @@ on: jobs: SyncFork: + name: SyncFork # 在最新版的Ubuntu系统上运行 runs-on: ubuntu-latest @@ -41,6 +42,17 @@ jobs: git remote add upstream "$REPO_URL" 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 run: | @@ -77,6 +89,8 @@ jobs: git push origin main --force CheckScores: + name: CheckScores + needs: SyncFork # 在最新版的Ubuntu系统上运行 runs-on: ubuntu-latest @@ -100,17 +114,6 @@ jobs: git config --global user.email "actions@github.com" 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 - name: Run main.py env: @@ -172,4 +175,4 @@ jobs: run: | git add . git commit -m "Update from GitHub Actions" || true - git push origin main --force \ No newline at end of file + git push origin main --force