Data updater every 3 days #28
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: Data updater every 3 days | |
on: | |
schedule: | |
- cron: 0 0 */3 * * | |
workflow_dispatch: | |
jobs: | |
update-files: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update lists | |
run: ./updaters/update-3-days.sh | |
- name: Commit files if changed | |
run: | | |
git add -N . | |
if [ -z "$(git ls-files --modified sources/)" ]; then | |
echo "[+] No files were changed" | |
else | |
echo "[+] Files were changed! Pushing changed..." | |
git pull | |
git stage sources/ | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m "[Github Action] Automated lists update." | |
git push | |
fi |