Fix SVG formatting to display properly on GitHub

Co-authored-by: pacnpal <183241239+pacnpal@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-17 17:51:48 +00:00
parent 6d115c9e65
commit 31002d5a5c
3 changed files with 28 additions and 4 deletions

View File

@@ -31,6 +31,32 @@ jobs:
path: profile/top-langs.svg
token: ${{ secrets.GITHUB_TOKEN }}
- name: Fix SVG formatting
run: |
# Remove leading whitespace from SVG files so they render properly on GitHub
python3 << 'EOF'
import glob
for filename in glob.glob('profile/*.svg'):
with open(filename, 'r') as f:
lines = f.readlines()
# Skip leading empty lines
start_idx = 0
for i, line in enumerate(lines):
if line.strip():
start_idx = i
break
# Strip leading whitespace from the first non-empty line
if start_idx < len(lines):
lines[start_idx] = lines[start_idx].lstrip()
# Write back starting from the first non-empty line
with open(filename, 'w') as f:
f.writelines(lines[start_idx:])
EOF
- name: Commit cards
run: |
git config user.name "github-actions[bot]"

View File

@@ -1,5 +1,4 @@
<svg
<svg
width="467"
height="195"
viewBox="0 0 467 195"

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -1,5 +1,4 @@
<svg
<svg
width="300"
height="165"
viewBox="0 0 300 165"

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB