Combine CSV Files #21
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: Combine CSV Files | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "17 3 * * 2-6" # Runs at 10:17 PM ET (3:17 am UTC) on weekdays | |
jobs: | |
combine_csv: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set Up Git | |
run: git config --global user.email "[email protected]" && git config --global user.name "GitHub Actions" | |
- name: Merge data CSV Files into one and remove the rest | |
run: | | |
cat *.csv > combined.csv | |
find . -maxdepth 1 -type f -name "*.csv" -not -name "combined.csv" -exec rm -f {} \; | |
- name: Rename Combined CSV and move to collected_data/ | |
run: | | |
mv combined.csv "collected_data/combined_$(TZ='America/Toronto' date +'%Y-%m-%d').csv" | |
- name: Commit and Push Changes | |
run: | | |
git add . | |
git commit -m "Merge CSV Files into one and remove the rest" | |
git push |