Skip to content

Commit 2ba15cf

Browse files
committed
improved has-artifacts
1 parent 587a59c commit 2ba15cf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

actions/has-artifacts/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ outputs:
2525
has-artifacts:
2626
description: whether there is a PR associated with that SHA with artifacts in staging
2727
value: ${{ steps.has-artifacts.outputs.has-artifacts }}
28+
platforms:
29+
description: the platforms that have artifacts
30+
value: ${{ steps.has-artifacts.outputs.platforms }}
2831

2932
runs:
3033
using: composite

actions/has-artifacts/has-artifacts.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ if (import.meta.main) {
4040
const objects = await bucket.listObjects({ prefix: `pull-request/${repo.split("/")[1]}/${pr}/` })
4141

4242
const hasArtifacts = (objects?.contents?.length || 0) > 0
43+
const platforms = objects?.contents?.map(o => o.key?.split("/").pop()) ?? []
4344

44-
Deno.stdout.write(new TextEncoder().encode(`has-artifacts=${hasArtifacts ? "true" : "false"}`))
45+
Deno.stdout.write(new TextEncoder().encode(`has-artifacts=${hasArtifacts ? "true" : "false"}\n`))
46+
Deno.stdout.write(new TextEncoder().encode(`platforms=${JSON.stringify(platforms)}\n`))
4547
}

0 commit comments

Comments
 (0)