Skip to content

Commit

Permalink
👷 Exporting PREVIEW_URL and DEPLOYMENT_UNIQUE_URL for use in othe…
Browse files Browse the repository at this point in the history
…r job steps
  • Loading branch information
mountainash committed Mar 11, 2024
1 parent 5f14dbf commit a951a91
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
- [x] Emojis in error logs to better see source of error/log
- [x] Using `@actions/exec` instead of spawn = require('child_process') for better OS portability
- [x] Fix: EditorConfig conflicted with Eslint rules
- [ ] Add a Workflow Summary to each run _basic one created, but could be improved_
- [x] Exporting `PREVIEW_URL` and `DEPLOYMENT_UNIQUE_URL` for use in other job steps

---

Expand Down
10 changes: 8 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32637,9 +32637,11 @@ const run = async () => {
}
}

const deploymentUniqueURL = deploymentUrls[deploymentUrls.length - 1]

core.setOutput('PREVIEW_URL', previewUrl)
core.setOutput('DEPLOYMENT_URLS', deploymentUrls)
core.setOutput('DEPLOYMENT_UNIQUE_URL', deploymentUrls[deploymentUrls.length - 1])
core.setOutput('DEPLOYMENT_UNIQUE_URL', deploymentUniqueURL)
core.setOutput('DEPLOYMENT_ID', deployment.id)
core.setOutput('DEPLOYMENT_INSPECTOR_URL', deployment.inspectorUrl)
core.setOutput('DEPLOYMENT_CREATED', true)
Expand All @@ -32650,10 +32652,14 @@ const run = async () => {
core.summary.addHeading('DEPLOYMENT_URLS', '2')
core.summary.addList(deploymentUrls)
core.summary.addEOL()
core.summary.addLink('DEPLOYMENT_UNIQUE_URL', deploymentUrls[deploymentUrls.length - 1])
core.summary.addLink('DEPLOYMENT_UNIQUE_URL', deploymentUniqueURL)
core.summary.addEOL()
core.summary.write()

// Set environment variable for use in subsequent job steps
core.exportVariable('PREVIEW_URL', previewUrl)
core.exportVariable('DEPLOYMENT_UNIQUE_URL', deploymentUniqueURL)

core.info('Done')
} catch (err) {
await github.updateDeployment('failure')
Expand Down
10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ const run = async () => {
}
}

const deploymentUniqueURL = deploymentUrls[deploymentUrls.length - 1]

core.setOutput('PREVIEW_URL', previewUrl)
core.setOutput('DEPLOYMENT_URLS', deploymentUrls)
core.setOutput('DEPLOYMENT_UNIQUE_URL', deploymentUrls[deploymentUrls.length - 1])
core.setOutput('DEPLOYMENT_UNIQUE_URL', deploymentUniqueURL)
core.setOutput('DEPLOYMENT_ID', deployment.id)
core.setOutput('DEPLOYMENT_INSPECTOR_URL', deployment.inspectorUrl)
core.setOutput('DEPLOYMENT_CREATED', true)
Expand All @@ -196,10 +198,14 @@ const run = async () => {
core.summary.addHeading('DEPLOYMENT_URLS', '2')
core.summary.addList(deploymentUrls)
core.summary.addEOL()
core.summary.addLink('DEPLOYMENT_UNIQUE_URL', deploymentUrls[deploymentUrls.length - 1])
core.summary.addLink('DEPLOYMENT_UNIQUE_URL', deploymentUniqueURL)
core.summary.addEOL()
core.summary.write()

// Set environment variable for use in subsequent job steps
core.exportVariable('PREVIEW_URL', previewUrl)
core.exportVariable('DEPLOYMENT_UNIQUE_URL', deploymentUniqueURL)

core.info('Done')
} catch (err) {
await github.updateDeployment('failure')
Expand Down

0 comments on commit a951a91

Please sign in to comment.