Skip to content

Commit 7ccf91c

Browse files
authored
Feature: Add base path (#16)
* Add base path to test which defaults to / * Add base_path to readme
1 parent d85a22d commit 7ccf91c

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Optional — Stringified HTTP Header object key/value pairs to send in requests
1616

1717
Optional — The amount of time to spend waiting on Netlify. Defaults to `60` seconds
1818

19+
### `base_path`
20+
21+
Optional — The page that needs to be tested for 200. Defaults to "/" (eg: `https://{site_name}.netlify.app{base_path}`)
22+
1923
## Outputs
2024

2125
### `url`

action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
max_timeout:
1414
description: "The max time to run the action"
1515
required: false
16+
base_path:
17+
description: "Base path to test"
18+
required: false
19+
default: "/"
1620
outputs:
1721
url:
1822
description: "The fully qualified deploy preview URL"

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ const run = async () => {
2626
}
2727
const MAX_TIMEOUT = Number(core.getInput("max_timeout")) || 60;
2828
const siteName = core.getInput("site_name");
29+
const basePath = core.getInput("base_path");
2930
if (!siteName) {
3031
core.setFailed("Required field `site_name` was not provided");
3132
}
32-
const url = `https://deploy-preview-${PR_NUMBER}--${siteName}.netlify.app`;
33+
const url = `https://deploy-preview-${PR_NUMBER}--${siteName}.netlify.app${basePath}`;
3334
core.setOutput("url", url);
3435
const extraHeaders = core.getInput("request_headers");
3536
const headers = !extraHeaders ? {} : JSON.parse(extraHeaders)

0 commit comments

Comments
 (0)