From 6d70e62c1a936df2de47df0cd053c0444731df8f Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Thu, 5 Mar 2026 14:18:07 +0100 Subject: [PATCH] Fixed URL --- .github/workflows/pull-request.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 5cf8b988..3883fb70 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -59,11 +59,6 @@ jobs: permissions: pull-requests: write steps: - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - name: Post PR comment with download links uses: actions/github-script@v7 with: @@ -73,19 +68,29 @@ jobs: const runId = context.runId; const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`; + // Fetch the list of artifacts for this run via the API + const artifactsResp = await github.rest.actions.listWorkflowRunArtifacts({ owner, repo, run_id: runId }); + const artifacts = artifactsResp.data.artifacts; + const envs = ['esp32s2', 'esp32s3', 'esp32c3', 'esp32', 'esp32solo', 'esp8266']; - const lines = envs.map(env => - `- **${env}**: [${env}.zip](${runUrl}/artifacts) (see artifacts on the [workflow run](${runUrl}))` - ); + const lines = envs.map(env => { + const artifact = artifacts.find(a => a.name === env); + if (artifact) { + // The artifact download page URL - directly navigable in the browser + const artifactUrl = `${runUrl}#artifacts-${env}`; + return `- **${env}**: [Download ${env}.zip](https://github.com/${owner}/${repo}/actions/runs/${runId}/artifacts/${artifact.id})`; + } + return `- **${env}**: ⚠️ artifact not found`; + }); const body = [ '## 🔧 PR Build Artifacts', '', - 'All environments built successfully. Download the zip files from the workflow run artifacts:', + 'All environments built successfully. Download the zip files:', '', ...lines, '', - `> [View all artifacts on the workflow run](${runUrl})`, + `> Artifacts expire after 7 days. [View workflow run](${runUrl})`, ].join('\n'); // Find and delete any previous bot comment to keep the PR clean