Skip to content

Commit

Permalink
Update action distribution files
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored May 27, 2024
1 parent 955a724 commit 2a3088c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions notify-discord/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28013,15 +28013,17 @@ async function run() {
const metadata = JSON.parse(fs.readFileSync(core.getInput('metadata'), 'utf8'));
let downloads = '';
for (const label in metadata.downloads) {
downloads += `- [${metadata.downloads[label].name}](${downloadsApiUrl}/${metadata.project}/versions/${metadata.version}/builds/${metadata.number}/downloads/${label})\n`;
const url = new URL(`/${metadata.project}/versions/${metadata.version}/builds/${metadata.number}/downloads/${label}`, downloadsApiUrl).href;
downloads += `- [${metadata.downloads[label].name}](${url})\n`;
}
embed.addField({ name: `Downloads (Build #${metadata.number})`, value: downloads, inline: false });
embed.addField({ name: `Downloads`, value: downloads, inline: false });
embed.addField({ name: '', value: `**Build #**: ${metadata.number}`, inline: true });
}
embed
.addField({ name: '', value: `Released: <t:${time}:R>`, inline: true })
.addField({ name: '', value: `Status: ${core.getInput('status')}`, inline: true })
.addField({ name: '', value: `Branch: [${branch}](${repoUrl}/tree/${branch})`, inline: true })
.addField({ name: '', value: `Run ID: [${runId}](${repoUrl}/actions/runs/${runId})`, inline: true });
.addField({ name: '', value: `**Released**: <t:${time}:R>`, inline: true })
.addField({ name: '', value: `**Status**: ${core.getInput('status')}`, inline: true })
.addField({ name: '', value: `**Branch**: [${branch}](${repoUrl}/tree/${branch})`, inline: true })
.addField({ name: '', value: `**Run ID**: [${runId}](${repoUrl}/actions/runs/${runId})`, inline: true });
try {
new discord_webhook_1.Webhook(core.getInput('discordWebhook'))
.setUsername('GitHub Actions')
Expand Down

0 comments on commit 2a3088c

Please sign in to comment.