Clone 仓库 #3792
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
name: Clone 仓库 | |
on: | |
schedule: | |
- cron: '*/15 * * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
deployments: write | |
jobs: | |
Clone: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 检出仓库 | |
uses: actions/checkout@v4 | |
- name: 删除当前已有的仓库 | |
run: sudo rm -rf Repo | |
- name: 运行 Bash 脚本和 Python 脚本 | |
run: | | |
mkdir Repo #root | |
cd Repo #root/Repo | |
cd .. #root | |
python "Clone Generator.py" #root | |
cd Repo #root/Repo | |
bash ../Clone.sh #root/Repo | |
cd .. #root | |
python Remove.py #root | |
- name: 更新时间 | |
id: read_file | |
run: | | |
export TZ='Asia/Shanghai' | |
echo "$(date '+%Y/%m/%d %H:%M:%S')" > LastUpdate | |
a=$(<LastUpdate) | |
echo "file_content=$a" >> $GITHUB_ENV | |
python "README Generator.py" #root | |
- name: 推送文件 | |
run: | | |
git config user.name "GitHub Action" | |
git config user.email "action@github.com" | |
git add . | |
git commit -m "${{ env.file_content }} Auto-update" | |
git pull --rebase | |
git push origin main |