Update Domain Dates #4
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: Update Domain Dates | |
on: | |
schedule: | |
- cron: '0 0 * * *' # 每天运行一次 | |
workflow_dispatch: # 允许手动触发 | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # 添加写入权限 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} # 使用 GitHub Token | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests pyyaml | |
- name: Run update script | |
run: python update_dates.py | |
- name: Commit changes | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add _config.yaml | |
git commit -m "Update domain registration dates" || echo "No changes to commit" | |
git push |