fix: no Python in container, reverting to awk

This commit is contained in:
2026-01-20 19:23:19 -05:00
parent 51703d45f8
commit 6283baf843

View File

@@ -20,22 +20,17 @@ jobs:
FORMATTED_LOC=$(printf "%'d" $LOC)
echo "Syncing $FORMATTED_LOC lines..."
python3 -c "
import os
content = open('README.md').read()
marker_start = ''
marker_end = ''
if marker_start in content and marker_end in content:
before = content.split(marker_start)[0]
after = content.split(marker_end)[1]
new_content = before + marker_start + '$FORMATTED_LOC' + marker_end + after
with open('README.md', 'w') as f:
f.write(new_content)
print('Successfully updated README.')
else:
print('Markers not found!')
exit(1)
"
awk -v new_val="$FORMATTED_LOC" '
/.*/ {
sub(/.*/, "" new_val "")
}
{ print }
' README.md > README.md.tmp && mv README.md.tmp README.md
if [ $(wc -l < README.md) -lt 5 ]; then
echo "ERROR: AWK output looks too small. Guarding against corruption."
exit 1
fi
- name: Commit and Push
run: |