Weekly Update Hosts #9
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: Weekly Update Hosts | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 0' | |
permissions: | |
contents: write | |
jobs: | |
update_hosts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Remove existing hosts (optional) | |
run: rm -f hosts || true | |
- name: Download script | |
run: curl -sSfL ${{ secrets.SCRIPT }} -o script.py | |
- name: Run Python script | |
run: python3 script.py | |
- name: Commit changes | |
run: | | |
git config --local user.name "elliottophellia" | |
git config --local user.email "me@rei.my.id" | |
git add hosts -f | |
git commit -m "π Update: $(date +'%Y-%m-%d %H:%M:%S %Z')" | |
git push -f |