Skip to content

Commit ba7de00

Browse files
authored
FIX: Always set a url (#24)
* FIX: Always set a url * FIX: Prop * FIX: Build * FIX: Name * FIX: Build
1 parent 736312a commit ba7de00

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

dist/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26264,7 +26264,13 @@ async function run() {
2626426264
core.debug('Artifacts JSON:')
2626526265
core.debug(artifacts)
2626626266
// e.g., {"next_page_token":null,"items":[{"path":"test_artifacts/root_artifact.md","node_index":0,"url":"https://output.circle-artifacts.com/output/job/6fdfd148-31da-4a30-8e89-a20595696ca5/artifacts/0/test_artifacts/root_artifact.md"}]}
26267-
const url = artifacts.items[0].url.split('/artifacts/')[0] + '/artifacts/' + path
26267+
var url = '';
26268+
if (artifacts.items.length > 0) {
26269+
url = artifacts.items[0].url.split('/artifacts/')[0] + '/artifacts/' + path
26270+
}
26271+
else {
26272+
url = payload.target_url;
26273+
}
2626826274
core.debug(`Linking to: ${url}`)
2626926275
core.debug((new Date()).toTimeString())
2627026276
core.setOutput("url", url)

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ async function run() {
5050
core.debug('Artifacts JSON:')
5151
core.debug(artifacts)
5252
// e.g., {"next_page_token":null,"items":[{"path":"test_artifacts/root_artifact.md","node_index":0,"url":"https://output.circle-artifacts.com/output/job/6fdfd148-31da-4a30-8e89-a20595696ca5/artifacts/0/test_artifacts/root_artifact.md"}]}
53-
const url = artifacts.items[0].url.split('/artifacts/')[0] + '/artifacts/' + path
53+
var url = '';
54+
if (artifacts.items.length > 0) {
55+
url = artifacts.items[0].url.split('/artifacts/')[0] + '/artifacts/' + path
56+
}
57+
else {
58+
url = payload.target_url;
59+
}
5460
core.debug(`Linking to: ${url}`)
5561
core.debug((new Date()).toTimeString())
5662
core.setOutput("url", url)

0 commit comments

Comments
 (0)