Commit 1374e43
committed
fix: prevent binary file corruption when encoding to base64
The base64-encoder was converting base64 strings back to buffers before
pushing them to the stream, which caused them to be re-encoded as UTF-8
bytes. This corrupted binary files (images, PDFs, etc.) when they were
committed and pushed to GitHub.
Changes:
- base64-encoder.ts: Push base64 strings directly instead of converting
them back to buffers. This prevents the double-encoding that was
corrupting binary data.
- blob.ts: Remove UTF-8 encoding from file stream reading. Files are now
read as raw buffers, which is necessary for the base64 encoder to work
correctly with both text and binary files.
The fix ensures that:
- Binary files (PNG, JPG, PDF, etc.) are encoded without corruption
- Text files continue to work correctly
- The action properly base64 encodes file content for GitHub API
Fixes image corruption when committing and pushing images to GitHub1 parent d2f2197 commit 1374e43
3 files changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29884 | 29884 | | |
29885 | 29885 | | |
29886 | 29886 | | |
| 29887 | + | |
| 29888 | + | |
| 29889 | + | |
29887 | 29890 | | |
29888 | | - | |
| 29891 | + | |
29889 | 29892 | | |
29890 | 29893 | | |
29891 | 29894 | | |
| |||
30591 | 30594 | | |
30592 | 30595 | | |
30593 | 30596 | | |
30594 | | - | |
| 30597 | + | |
30595 | 30598 | | |
30596 | 30599 | | |
30597 | 30600 | | |
30598 | 30601 | | |
30599 | | - | |
| 30602 | + | |
30600 | 30603 | | |
30601 | 30604 | | |
30602 | 30605 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
0 commit comments