Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEV-2273] Fix schools updater #238

Merged
merged 3 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/schools_updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,18 @@ jobs:
- name: Filter JSON to only include school names and save as school.csv
run: |
CSV_FILE=schools.csv
if [ -f "$CSV_FILE" ]; then
rm "$CSV_FILE"
echo "Removed existing $CSV_FILE"
fi
# Add first line to CSV file
CURRENT_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")
echo "\"Below is a list of all schools that we've manually verified. If you see one that hasn't been included, please add it via my.mlh.io and we'll verify it soon. List last updated at: $CURRENT_TIMESTAMP.\"" > schools.csv
# Extract only the "name" field from each entry and overwrite data.json
jq -r '.[].name' data.json >> schools.csv
echo "\"Below is a list of all schools that we've manually verified. If you see one that hasn't been included, please add it via my.mlh.io and we'll verify it soon. List last updated at: $CURRENT_TIMESTAMP.\"" > $CSV_FILE
# Wrap each "name" in an array to use @csv for correct CSV formatting
jq -r '.[].name | [.] | @csv' data.json >> schools.csv
jq -r '.[].name | [.] | @csv' data.json >> $CSV_FILE
- name: Commit and push CSV file using deploy key
env:
Expand Down
Loading