Skip to content

Instantly share code, notes, and snippets.

@triangletodd
Last active May 13, 2025 14:24
Show Gist options
  • Save triangletodd/c6a909378f1ab25b8cd54ecac0d5d6e9 to your computer and use it in GitHub Desktop.
Save triangletodd/c6a909378f1ab25b8cd54ecac0d5d6e9 to your computer and use it in GitHub Desktop.
Parse GitHub GEI migration errors and dump to CSV.
#!/usr/bin/env bash
set -ex
error_files=$(rg 'migration failed' | cut -d':' -f1 | sort | uniq)
echo "Failure,Assignee,Status,Reason,Notes"
for file in $error_files; do
repo="$(grep 'GITHUB REPO' $file | perl -pe 's/.*GITHUB REPO: (.*)/\1/')"
error="$(grep 'ERROR' $file | tail -1 | perl -pe 's/.*\[ERROR\] (.*)/\1/'| perl -pe 's/"/""/g')"
echo "\"${repo}.log\",,,,\"${error}\""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment