Skip to content

Commit 548bff7

Browse files
committed
Refactor app delivery code
1 parent 41d9b23 commit 548bff7

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

.github/workflows/app_delivery.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ jobs:
4242
4343
for (const workflowName of buildWorkflowNames) {
4444
// 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);
4846
4947
if (!latestRun) {
5048
console.log(`Could not find a successful run for workflow: ${workflowName}`);
@@ -72,18 +70,16 @@ jobs:
7270
commentBody += `### ${workflowName} (Run #${latestRun.run_number})\n`;
7371
7472
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`;
7674
artifactsFound = true;
7775
}
7876
}
7977
} 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;
8783
}
8884
}
8985

0 commit comments

Comments
 (0)