-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b8bf2b
commit b5e45b2
Showing
3 changed files
with
64 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,75 @@ | ||
name: Run Python Script and Update README | ||
# name: Run Python Script and Update README | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# branches: | ||
# - main | ||
# workflow_dispatch: | ||
|
||
|
||
|
||
jobs: | ||
run-script: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout main branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: "main" | ||
fetch-depth: 0 | ||
token: ${{ secrets.ATTICUS_PAT }} | ||
# jobs: | ||
# run-script: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout main branch | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# ref: "main" | ||
# fetch-depth: 0 | ||
# token: ${{ secrets.ATTICUS_PAT }} | ||
|
||
# 新增:创建并切换到CI分支 | ||
- name: Checkout CI branch | ||
run: | | ||
git fetch origin | ||
if git branch --list ci-auto-update; then | ||
git checkout ci-auto-update | ||
else | ||
git checkout -b ci-auto-update | ||
fi | ||
git reset --hard origin/main | ||
# # 新增:创建并切换到CI分支 | ||
# - name: Checkout CI branch | ||
# run: | | ||
# git fetch origin | ||
# if git branch --list ci-auto-update; then | ||
# git checkout ci-auto-update | ||
# else | ||
# git checkout -b ci-auto-update | ||
# fi | ||
# git reset --hard origin/main | ||
|
||
- name: Configuring git credentials | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Atticuszz" | ||
# - name: Configuring git credentials | ||
# run: | | ||
# git config --global user.email "[email protected]" | ||
# git config --global user.name "Atticuszz" | ||
|
||
# 以下步骤保持不变,但是现在它们在CI分支上执行 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
# # 以下步骤保持不变,但是现在它们在CI分支上执行 | ||
# - name: Set up Python | ||
# uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: "3.11" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install useful-scripts pre-commit | ||
# - name: Install dependencies | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# pip install useful-scripts pre-commit | ||
|
||
- name: Run pre-commit hooks | ||
run: pre-commit run --all-files | ||
continue-on-error: true | ||
# - name: Run pre-commit hooks | ||
# run: pre-commit run --all-files | ||
# continue-on-error: true | ||
|
||
- name: Run the script for recently modified | ||
run: markdown --root ${{ github.workspace }} modify_recent --output ${{ github.workspace }}/README.md --num_commits 15 --dir docs --title "## 最近修改" | ||
# - name: Run the script for recently modified | ||
# run: markdown --root ${{ github.workspace }} modify_recent --output ${{ github.workspace }}/README.md --num_commits 15 --dir docs --title "## 最近修改" | ||
|
||
|
||
- name: Commit README changes | ||
run: | | ||
git add . | ||
git commit -m "Ci workflows" || echo "No changes to commit" | ||
git push origin ci-auto-update --force | ||
# - name: Commit README changes | ||
# run: | | ||
# git add . | ||
# git commit -m "Ci workflows" || echo "No changes to commit" | ||
# git push origin ci-auto-update --force | ||
|
||
# 新增:创建或更新 PR 到主分支 | ||
- name: Create Pull Request | ||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
pr_title: "Update from CI" | ||
pr_body: "This is an automated PR to update contents" | ||
source_branch: "ci-auto-update" | ||
destination_branch: "main" | ||
# # 新增:创建或更新 PR 到主分支 | ||
# - name: Create Pull Request | ||
# if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' | ||
# uses: repo-sync/pull-request@v2 | ||
# with: | ||
# github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# pr_title: "Update from CI" | ||
# pr_body: "This is an automated PR to update contents" | ||
# source_branch: "ci-auto-update" | ||
# destination_branch: "main" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1228,4 +1228,4 @@ | |
"detail": "scripts", | ||
"documentation": {} | ||
} | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"DockerRun.DisableAutoGenerateConfig": true | ||
} | ||
} |