Download and Commit File #504
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: Download and Commit File | |
on: | |
schedule: | |
- cron: "0 0 * * *" # Runs at 00:00 UTC every day | |
workflow_dispatch: | |
jobs: | |
download-and-commit: | |
runs-on: ubuntu-latest | |
name: Job to Download Items | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Download Files | |
uses: ./ | |
env: | |
DOWNLOAD_ITEMS: ${{ secrets.DOWNLOAD_ITEMS }} | |
- name: Commit and Push | |
run: | | |
git status --porcelain | |
git_status=$(git status --porcelain) | |
if [[ -n $git_status ]]; then | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add -f data/* | |
git commit -m "Update downloaded file" | |
git push | |
fi |