Skip to content

Commit

Permalink
Add correct data/ path to workflow yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenwindflower committed Mar 16, 2024
1 parent be06b08 commit 968559d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ jobs:
uv pip install -r requirements.txt --system
- name: Fetch latest data
run: |
cp Street_Tree_List.csv Street_Tree_List-old.csv
cp data/Street_Tree_List.csv Street_Tree_List-old.csv
curl -o Street_Tree_List-unsorted.csv "https://data.sfgov.org/api/views/tkzw-k3nq/rows.csv?accessType=DOWNLOAD"
# Remove heading line and use it to start a new file
head -n 1 Street_Tree_List-unsorted.csv > Street_Tree_List.csv
head -n 1 Street_Tree_List-unsorted.csv > data/Street_Tree_List.csv
# Sort all but the first line and append to that file
tail -n +2 "Street_Tree_List-unsorted.csv" | sort >> Street_Tree_List.csv
tail -n +2 "Street_Tree_List-unsorted.csv" | sort >> data/Street_Tree_List.csv
# Generate commit message using csv-diff
csv-diff Street_Tree_List-old.csv Street_Tree_List.csv --key=TreeID --singular=tree --plural=trees > message.txt
csv-diff Street_Tree_List-old.csv data/Street_Tree_List.csv --key=TreeID --singular=tree --plural=trees > message.txt
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add Street_Tree_List.csv
git add data/Street_Tree_List.csv
timestamp=$(date -u)
git commit -F message.txt || exit 0
git push

0 comments on commit 968559d

Please sign in to comment.