Skip to content

Download and Commit File #105

Download and Commit File

Download and Commit File #105

Workflow file for this run

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
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Download File
env:
DOWNLOAD_ITEMS: ${{ secrets.DOWNLOAD_ITEMS }}
run: |
mkdir -p "$GITHUB_WORKSPACE/data"
./scripts/download.sh 2>&1
- 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