Skip to content

Commit 1c21075

Browse files
committed
fix: bad input validation for download base url
1 parent c967acc commit 1c21075

6 files changed

Lines changed: 11 additions & 9 deletions

File tree

action/dist/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19864,7 +19864,7 @@ function parseInputs() {
1986419864
const agentDownloadBaseURL = formatUrlWithTrailingSlash(
1986519865
core.getInput("_agent-download-base-url")
1986619866
);
19867-
if (!agentDownloadBaseURL) {
19867+
if (!agentDownloadBaseURL && !localAgent) {
1986819868
throw new Error(`_agent-download-base-url cannot be empty`);
1986919869
}
1987019870
return {
@@ -19952,6 +19952,7 @@ async function installAgent({
1995219952
await downloadAgent({
1995319953
actionDirectory,
1995419954
agentDirectory,
19955+
// Input validation will ensure there is a value when localAgent = false
1995519956
agentDownloadBaseURL,
1995619957
version
1995719958
});

action/dist/main.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/dist/post.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19876,7 +19876,7 @@ function parseInputs() {
1987619876
const agentDownloadBaseURL = formatUrlWithTrailingSlash(
1987719877
core.getInput("_agent-download-base-url")
1987819878
);
19879-
if (!agentDownloadBaseURL) {
19879+
if (!agentDownloadBaseURL && !localAgent) {
1988019880
throw new Error(`_agent-download-base-url cannot be empty`);
1988119881
}
1988219882
return {

action/dist/post.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/src/inputs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface Inputs {
1313
egressPolicy: EgressPolicy;
1414
localAgent: boolean;
1515
logDirectory: string;
16-
agentDownloadBaseURL: string;
16+
agentDownloadBaseURL?: string;
1717
agentVersion?: string;
1818
controlPlaneApiBaseUrl?: string;
1919
controlPlaneWebappBaseUrl?: string;

action/src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,16 @@ async function installAgent({
6565
agentDirectory: string;
6666
localAgent: boolean;
6767
version: string;
68-
agentDownloadBaseURL: string;
68+
agentDownloadBaseURL?: string;
6969
}): Promise<void> {
7070
if (localAgent) {
7171
await copyLocalAgent({ agentDirectory });
7272
} else {
7373
await downloadAgent({
7474
actionDirectory,
7575
agentDirectory,
76-
agentDownloadBaseURL,
76+
// Input validation will ensure there is a value when localAgent = false
77+
agentDownloadBaseURL: agentDownloadBaseURL!,
7778
version,
7879
});
7980
}

0 commit comments

Comments
 (0)