Skip to content

Commit

Permalink
Introduces a way to navigate to a particular page when viewing a depl…
Browse files Browse the repository at this point in the history
…oyment
  • Loading branch information
umair-ably committed Dec 12, 2024
1 parent ce894b0 commit 9544818
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 8 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/';
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9544818

Please sign in to comment.