This commit is contained in:
NianBroken
2024-02-14 14:48:29 +08:00 Unverified
parent 5fffa12b4f
commit 05ca0b8604
+37 -14
View File
@@ -17,7 +17,7 @@ on:
- "False"
jobs:
CheckScores:
SyncFork:
# 在最新版的Ubuntu系统上运行
runs-on: ubuntu-latest
@@ -26,11 +26,9 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@main
# 配置Python环境 "*"表示最新版
# 配置Python环境
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: "*"
# 使用pip安装项目的依赖项
- name: Install dependencies
@@ -91,6 +89,37 @@ jobs:
done
rm -rf backup
# 将更改强制推送到main分支
- name: Force push changes to main branch
run: |
git add .
git commit -m "Update branch" || true
git push origin main --force
CheckScores:
# 在最新版的Ubuntu系统上运行
runs-on: ubuntu-latest
steps:
# 使用GitHub Actions提供的动作来检出代码库
- name: Checkout Repository
uses: actions/checkout@main
# 配置Python环境
- name: Set up Python
uses: actions/setup-python@main
# 使用pip安装项目的依赖项
- name: Install dependencies
run: |
pip install requests rsa pyquery
# 配置Git用户信息
- name: Configure Git
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
# 运行主程序main.py
- name: Run main.py
env:
@@ -115,6 +144,7 @@ jobs:
export BEIJING_TIME="$(TZ='Asia/Shanghai' date +'%Y-%m-%d %H:%M:%S:%3N')"
python main.py
echo "------"
# 判断环境变量是否为空
if [ -z "$URL" ]; then
echo "URL secret is empty!"
@@ -128,6 +158,7 @@ jobs:
if [ -z "$TOKEN" ]; then
echo "TOKEN secret is empty!"
fi
# 方便通过截图快速定位到用户
echo "Force Push Message: $FORCE_PUSH_MESSAGE"
echo "main.yml Files Inconsistent: $MAIN_YML_FILES_INCONSISTENT"
@@ -145,17 +176,9 @@ jobs:
run: |
rm -rf __pycache__
# 将当前目录中的所有更改添加到Git的暂存区
- name: Add changes
run: |
git add .
# 提交更改到Git仓库
- name: Commit changes
run: |
git commit -m "Update from GitHub Actions" || true
# 将更改强制推送到main分支
- name: Force push changes to main branch
run: |
git add .
git commit -m "Update from GitHub Actions" || true
git push origin main --force