Skip to content

Commit cdd1e68

Browse files
committed
Fixed spec json
1 parent c647e62 commit cdd1e68

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

__tests__/main.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ describe('action', () => {
174174
fetchMock.mockResponseOnce(JSON.stringify({ items: [] }), { status: 200 })
175175
fetchMock.mockResponseOnce(JSON.stringify({}), { status: 200 })
176176
await main.run()
177+
expect(fetchMock).toHaveBeenNthCalledWith(
178+
1,
179+
'https://example.com/api/v1/admin/extensions?search=ValeLS',
180+
expect.anything()
181+
)
177182
expect(fetchMock).toHaveBeenNthCalledWith(
178183
2,
179184
'https://example.com/api/v1/admin/extensions',

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 2 additions & 1 deletion
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.

src/main.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ export async function run(): Promise<void> {
1818
const token: string = core.getInput('token')
1919

2020
const spec = await fs.readFile(specPath)
21-
const asJson = jsonFromSpec(spec.toString())
21+
const asJson = JSON.parse(jsonFromSpec(spec.toString()))
22+
23+
core.debug(`Parsed spec: ${JSON.stringify(asJson)}`)
2224

2325
if (isTest) {
2426
// console.log(asJson)
2527
// The following only works with secret keys etc.
2628
return
2729
}
30+
2831
await createOrUpdateExtension(
2932
downloadUrl,
3033
asJson as unknown as PluginMetaData,

0 commit comments

Comments
 (0)