|
42 | 42 | |
43 | 43 | for (const workflowName of buildWorkflowNames) { |
44 | 44 | // Filter to find the run matching the exact workflow name |
45 | | - const latestRun = runsResponse.data.workflow_runs.find(run => |
46 | | - run.name === workflowName && run.conclusion === 'success' |
47 | | - ); |
| 45 | + const latestRun = runsResponse.data.workflow_runs.find(run => run.name === workflowName); |
48 | 46 | |
49 | 47 | if (!latestRun) { |
50 | 48 | console.log(`Could not find a successful run for workflow: ${workflowName}`); |
@@ -72,18 +70,16 @@ jobs: |
72 | 70 | commentBody += `### ${workflowName} (Run #${latestRun.run_number})\n`; |
73 | 71 | |
74 | 72 | for (const artifact of artifacts) { |
75 | | - commentBody += `|**${workflowName}**| 📬 | [**${artifact.name}**](${artifact.archive_download_url}) | (Expires: ${new Date(artifact.expires_at).toLocaleDateString()}) | [#${latestRun.run_number}](${latestRun.html_url}) |\n`; |
| 73 | + commentBody += `|**${workflowName}**| 📬 | [**${artifact.name}**](${artifact.archive_download_url}) | Expires: ${new Date(artifact.expires_at).toLocaleDateString('en-GB')} | [#${latestRun.run_number}](${latestRun.html_url}) |\n`; |
76 | 74 | artifactsFound = true; |
77 | 75 | } |
78 | 76 | } |
79 | 77 | } else { |
80 | | - if (latestRun.conclusion) { |
81 | | - const currentYear = String(new Date().getFullYear()).slice(-2) |
82 | | - const currentMonth = (new Date().getMonth() + 1).toLocaleString('en-US', {minimumIntegerDigits: 2, useGrouping:false}) |
83 | | - const buildId = `${latestRun.run_number}1${latestRun.run_attempt}` |
84 | | - commentBody += `|**${workflowName}**| 📬 | | Build number: ${currentYear}.${currentMonth}.${buildId} | [#${latestRun.run_number}](${latestRun.html_url}) |\n`; |
85 | | - artifactsFound = true; |
86 | | - } |
| 78 | + const currentYear = String(new Date().getFullYear()).slice(-2) |
| 79 | + const currentMonth = (new Date().getMonth() + 1).toLocaleString('en-US', {minimumIntegerDigits: 2, useGrouping:false}) |
| 80 | + const buildId = `${latestRun.run_number}1${latestRun.run_attempt}` |
| 81 | + commentBody += `|**${workflowName}**| 📬 | | Build number: ${currentYear}.${currentMonth}.${buildId} | [#${latestRun.run_number}](${latestRun.html_url}) |\n`; |
| 82 | + artifactsFound = true; |
87 | 83 | } |
88 | 84 | } |
89 | 85 | |
|
0 commit comments