Update
This commit is contained in:
+15
-12
@@ -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
|
||||
git push origin main --force
|
||||
|
||||
Reference in New Issue
Block a user