@@ -59,23 +59,30 @@ jobs:
59
59
needs : measure-venv
60
60
runs-on : ubuntu-latest
61
61
steps :
62
- - name : Post comment to PR
63
- uses : actions/github-script@v7
64
- with :
65
- script : |
66
- const sizes = {
67
- "3.9": "${{ needs.measure-venv.outputs.py39 || 'N/A' }}",
68
- "3.10": "${{ needs.measure-venv.outputs.py310 || 'N/A' }}",
69
- "3.11": "${{ needs.measure-venv.outputs.py311 || 'N/A' }}",
70
- "3.12": "${{ needs.measure-venv.outputs.py312 || 'N/A' }}",
71
- };
72
- const lines = Object.entries(sizes).map(([ver, size]) => `Python ${ver}: ${size} MB`);
73
- const body = `Bittensor SDK virtual environment sizes by Python version:**\n\n\`\`\`\n${lines.join("\n")}\n\`\`\``;
74
-
75
- const { owner, repo } = context.repo;
76
- github.rest.issues.createComment({
77
- issue_number : context.payload.pull_request.number,
78
- owner,
79
- repo,
80
- body
81
- });
62
+ - name : Post venv size summary to PR
63
+ uses : actions/github-script@v7
64
+ with :
65
+ github-token : ${{ secrets.GITHUB_TOKEN }}
66
+ script : |
67
+ const sizes = {
68
+ "3.9": "${{ needs.measure-venv.outputs.py39 || 'N/A' }}",
69
+ "3.10": "${{ needs.measure-venv.outputs.py310 || 'N/A' }}",
70
+ "3.11": "${{ needs.measure-venv.outputs.py311 || 'N/A' }}",
71
+ "3.12": "${{ needs.measure-venv.outputs.py312 || 'N/A' }}",
72
+ };
73
+
74
+ const body = [
75
+ '**Bittensor SDK virtual environment sizes by Python version:**',
76
+ '',
77
+ '```'
78
+ ]
79
+ .concat(Object.entries(sizes).map(([v, s]) => `Python ${v}: ${s} MB`))
80
+ .concat(['```'])
81
+ .join('\n');
82
+
83
+ github.rest.issues.createComment({
84
+ issue_number: context.issue.number,
85
+ owner: context.repo.owner,
86
+ repo: context.repo.repo,
87
+ body
88
+ });
0 commit comments