Skip to content

Commit

Permalink
Merge pull request #30 from sheavescapital/action-outputs
Browse files Browse the repository at this point in the history
Add action outputs for site id and url
  • Loading branch information
bakerkretzmar authored Nov 10, 2023
2 parents 04b5f7d + 960b8a5 commit 15a17c9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ inputs:
clone-certificate:
description: Forge SSL certificate ID to clone to the preview site.
required: false
outputs:
site-url:
description: 'The URL of the site that was deployed.'
site-id:
description: 'The Forge ID of the site that was created.'
runs:
using: node20
main: dist/index.js
2 changes: 1 addition & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export async function createPreview({
core.info('Waiting for SSL certificate to be activated.');
await site.ensureCertificateActivated();

return { url: `https://${site.name}` };
return { url: `https://${site.name}`, id: site.id };
}

export async function destroyPreview({
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ export async function run() {
});

if (preview) {
core.setOutput('site-url', preview.url);
core.setOutput('site-id', preview.id);

const octokit = github.getOctokit(githubToken);
octokit.rest.issues.createComment({
owner: pr.repository.owner.login,
Expand Down

0 comments on commit 15a17c9

Please sign in to comment.