Skip to content

Commit c736bab

Browse files
JoeMattclaude
andcommitted
Use actual artifact URLs instead of generic run link
Fetch the artifact list from the workflow run API and generate per-artifact download links with sizes, instead of pointing every row at the same run URL. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 4136d68 commit c736bab

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

.github/workflows/c-cpp.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,23 @@ jobs:
9292
script: |
9393
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
9494
95+
// Fetch actual artifact list from this workflow run
96+
const { data: { artifacts } } = await github.rest.actions.listWorkflowRunArtifacts({
97+
owner: context.repo.owner,
98+
repo: context.repo.repo,
99+
run_id: context.runId,
100+
});
101+
102+
let rows = '';
103+
for (const a of artifacts) {
104+
const dlUrl = `${runUrl}/artifacts/${a.id}`;
105+
rows += `| ${a.name} | [${a.name}](${dlUrl}) | ${(a.size_in_bytes / 1024).toFixed(0)} KB |\n`;
106+
}
107+
108+
if (!rows) {
109+
rows = `| - | No artifacts found | - |\n`;
110+
}
111+
95112
const comments = await github.paginate(
96113
github.rest.issues.listComments,
97114
{
@@ -108,15 +125,11 @@ jobs:
108125
marker,
109126
'### Build Artifacts',
110127
'',
111-
'| Platform | Download |',
112-
'|----------|----------|',
113-
'| Linux x86_64 (GCC) | [virtualjaguar_libretro.so](' + runUrl + ') |',
114-
'| Linux x86_64 (Clang) | [virtualjaguar_libretro.so](' + runUrl + ') |',
115-
'| Linux aarch64 | [virtualjaguar_libretro.so](' + runUrl + ') |',
116-
'| macOS arm64 | [virtualjaguar_libretro.dylib](' + runUrl + ') |',
117-
'| Windows x86_64 | [virtualjaguar_libretro.dll](' + runUrl + ') |',
128+
'| Platform | Download | Size |',
129+
'|----------|----------|------|',
130+
rows.trim(),
118131
'',
119-
'> Download artifacts from the [workflow run](' + runUrl + ').',
132+
`> [Full workflow run](${runUrl})`,
120133
'',
121134
`<sub>Updated by CI at ${new Date().toISOString()}</sub>`,
122135
].join('\n');

0 commit comments

Comments
 (0)