Skip to content

Commit 34f0133

Browse files
Merge pull request #24 from depot/outputs
2 parents d765127 + b94b29e commit 34f0133

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,7 @@ outputs:
135135
description: 'Image digest'
136136
metadata:
137137
description: 'Build result metadata'
138+
build-id:
139+
description: 'Build ID'
140+
project-id:
141+
description: 'Project ID'

dist/index.js

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

+10
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ async function main() {
3939
await core.group(`Metadata`, async () => {
4040
core.info(metadata)
4141
core.setOutput('metadata', metadata)
42+
43+
try {
44+
const parsed = JSON.parse(metadata)
45+
if (parsed?.['depot.build']?.buildID) {
46+
core.setOutput('build-id', parsed['depot.build'].buildID)
47+
}
48+
if (parsed?.['depot.build']?.projectID) {
49+
core.setOutput('project-id', parsed['depot.build'].projectID)
50+
}
51+
} catch {}
4252
})
4353
}
4454
}

0 commit comments

Comments
 (0)