Generate API Data #6290
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: Generate API Data | |
on: | |
schedule: | |
- cron: '0 * * * *' | |
push: | |
branches: | |
- main | |
jobs: | |
generate-data: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Generate Data | |
run: node api/index.cjs | |
- name: Commit files | |
run: | | |
git config --local user.name actions-user | |
git config --local user.email "actions@github.com" | |
git add '*' | |
if [[ `git status --porcelain` ]]; then | |
echo "OK: Changes detected." | |
git commit -am "gh-action get wapo data: $(date)" | |
git push origin main | |
else | |
echo "No changes were detected." | |
fi |