Skip to content

Commit

Permalink
Merge pull request #24 from depot/outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie committed Oct 26, 2023
2 parents d765127 + b94b29e commit 34f0133
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@ outputs:
description: 'Image digest'
metadata:
description: 'Build result metadata'
build-id:
description: 'Build ID'
project-id:
description: 'Project ID'
10 changes: 5 additions & 5 deletions dist/index.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ async function main() {
await core.group(`Metadata`, async () => {
core.info(metadata)
core.setOutput('metadata', metadata)

try {
const parsed = JSON.parse(metadata)
if (parsed?.['depot.build']?.buildID) {
core.setOutput('build-id', parsed['depot.build'].buildID)
}
if (parsed?.['depot.build']?.projectID) {
core.setOutput('project-id', parsed['depot.build'].projectID)
}
} catch {}
})
}
}
Expand Down

0 comments on commit 34f0133

Please sign in to comment.