diff --git a/action.yml b/action.yml index 4593d68..94a8dc4 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,11 @@ inputs: If not supplied or supplied as an empty string then the artifacts are uploaded to S3 at root for this deployment context. required: false default: '' + landingPagePath: + description: | + The extension applied to the baseURL to aid in navigating to the correct page. e.g. if this value is "/documentation/home", then opening a deployment will navigate to this page. + required: false + default: '' mode: description: | Specify `"preempt"` in order use this action before content build in order to output the URL base. diff --git a/src/index.ts b/src/index.ts index f219262..adf0b2a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -61,6 +61,11 @@ const sourcePath = path.resolve(core.getInput('sourcePath', {required: true})); // - Empty string indicates no value, i.e. artifact name not specified const artifactName = core.getInput('artifactName'); +// Optional landingPagePath: +// - The getInput() method calls trim() for us by default (trimWhitespace: true) +// - Empty string indicates no value, i.e. landingPagePath not specified +const landingPagePath = core.getInput('landingPagePath'); + let githubDeploymentRef: string; let s3KeyPrefix = `builds/${context.repo.owner}/${context.repo.repo}/`; let githubEnvironmentName = 'staging/'; @@ -132,9 +137,9 @@ const setDeploymentStatus = async (id: number, state: 'in_progress' | 'success' ...context.repo, deployment_id: id, state, - log_url: url, - target_url: url, - environment_url: url, + log_url: url + landingPagePath, + target_url: url + landingPagePath, + environment_url: url + landingPagePath, mediaType: { // 'flash' is needed to use the 'in_progress' state // 'ant-man' is needed to use the log_url property