diff --git a/src/action.ts b/src/action.ts index 349b634..a88ca2f 100644 --- a/src/action.ts +++ b/src/action.ts @@ -133,4 +133,6 @@ export async function destroyPreview({ core.info('Deleting database.'); await site.deleteDatabase(normalizeDatabaseName(branch)); } + + return { id: site.id }; } diff --git a/src/main.ts b/src/main.ts index 4290327..b904f63 100644 --- a/src/main.ts +++ b/src/main.ts @@ -114,11 +114,15 @@ export async function run() { }); } } else if (pr.action === 'closed') { - await destroyPreview({ + const preview = await destroyPreview({ branch: pr.pull_request.head.ref, servers, environment, }); + + if (preview) { + core.setOutput('site-id', preview.id); + } } } catch (error) { if (error instanceof ForgeError) {