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 4cdf6f5 commit 1b6b4d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions notify-discord/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27996,7 +27996,8 @@ async function run() {
try {
const status = core.getInput('status');
const failed = status === 'failure';
const includeDownloads = core.getBooleanInput('includeDownloads');
const metadataFile = core.getInput('metadata');
const includeDownloads = core.getBooleanInput('includeDownloads') && fs.existsSync(metadataFile);
const downloadsApiUrl = core.getInput('downloadsApiUrl');
const color = failed ? '#e00016' : '#03fc5a';
const body = core.getInput('body');
Expand All @@ -28010,7 +28011,7 @@ async function run() {
.setColor(color)
.setDescription(body);
if (!failed && includeDownloads) {
const metadata = JSON.parse(fs.readFileSync(core.getInput('metadata'), 'utf8'));
const metadata = JSON.parse(fs.readFileSync(metadataFile, 'utf8'));
let downloads = '';
for (const label in metadata.downloads) {
const url = new URL(`${metadata.project}/versions/${metadata.version}/builds/${metadata.number}/downloads/${label}`, downloadsApiUrl).href;
Expand Down

0 comments on commit 1b6b4d2

Please sign in to comment.