Skip to content

Commit bddaf7f

Browse files
committed
chore: add summary to Action
1 parent 5f22145 commit bddaf7f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,24 @@ runs:
8989
${{ inputs.only != '' && format('--only "{0}"', inputs.only) || ''}}
9090
shell: pwsh
9191
if: runner.os == 'Windows'
92+
93+
- run: |
94+
# Prepare summary
95+
${{ steps.python.outputs.python-path }}" -u << "EOF"
96+
import os
97+
from pathlib import Path
98+
99+
output_dir = Path("${{ inputs.output-dir != '' && format('--output-dir "{0}"', inputs.output-dir) || ''}}" or 'wheelhouse')
100+
101+
with Path(os.environ["GITHUB_STEP_SUMMARY"]).open("w", encoding="utf-8") as f:
102+
print("## Files in output directory", file=f)
103+
print(file=f)
104+
for item in output_dir.iterdir():
105+
if item.is_file():
106+
size_mb = item.stat().st_size / 1024**2
107+
print(f"* `{item}` - {size_mb:.2f} MB", file=f)
108+
else:
109+
print(f"* `{item.name}/`", file=f)
110+
print(file=f)
111+
EOF
112+
shell: bash

0 commit comments

Comments
 (0)