Fetch and save robots.txt #8
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: "Fetch and save robots.txt" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 16 * * 1' # * 16:00 UTC +08:00 Mondays | |
jobs: | |
process: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Push changes | |
run: | | |
curl https://raw.githubusercontent.com/ai-robots-txt/ai.robots.txt/refs/heads/main/robots.txt > robots.txt | |
git config user.email "[email protected]" | |
git config user.name "guardian [bot]" | |
git add robots.txt | |
git commit -m "Update robots.txt" || echo "Nothing changed in ai-robots-txt.txt" | |
git fetch origin main | |
git push origin HEAD:main |