Skip to content

Commit 918b141

Browse files
committed
chore: add base-url input
1 parent 7fa228c commit 918b141

File tree

6 files changed

+59
-51
lines changed

6 files changed

+59
-51
lines changed

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ branding:
44
icon: file-plus
55
description: Upload your OpenAPI specification to Hey API
66
inputs:
7+
base-url:
8+
description: Configure Hey API server URL
9+
required: false
710
dry-run:
811
description: Run action in dry run mode
912
required: false

dist/index.js

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

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

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

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export async function run(): Promise<void> {
2727
baseUrl,
2828
dryRun,
2929
heyApiToken,
30-
pathToOpenApi,
30+
pathToOpenApi
3131
})
3232
core.debug(`Upload completed: ${new Date().toTimeString()}`)
3333
} catch (error) {

src/upload.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ export async function upload({
77
baseUrl = 'https://platform-production-25fb.up.railway.app',
88
dryRun,
99
heyApiToken,
10-
pathToOpenApi,
10+
pathToOpenApi
1111
}: {
12-
baseUrl?: string;
13-
dryRun?: boolean;
12+
baseUrl?: string
13+
dryRun?: boolean
1414
/**
1515
* Hey API token.
1616
*/
17-
heyApiToken: string;
17+
heyApiToken: string
1818
/**
1919
* Path to the OpenAPI specification file.
2020
*/
21-
pathToOpenApi: string;
21+
pathToOpenApi: string
2222
}): Promise<void> {
2323
if (!pathToOpenApi) {
2424
throw new Error('invalid OpenAPI path')
@@ -52,10 +52,10 @@ export async function upload({
5252
body,
5353
headers: {
5454
Authorization: `Bearer ${heyApiToken}`,
55-
'Content-Type': 'multipart/form-data',
55+
'Content-Type': 'multipart/form-data'
5656
},
57-
method: 'POST',
58-
});
57+
method: 'POST'
58+
})
5959

6060
if (response.status >= 300) {
6161
const error = await response.json()

0 commit comments

Comments
 (0)