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