Skip to content

Commit

Permalink
Fixed spec json
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddimax committed Aug 13, 2024
1 parent c647e62 commit cdd1e68
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ describe('action', () => {
fetchMock.mockResponseOnce(JSON.stringify({ items: [] }), { status: 200 })
fetchMock.mockResponseOnce(JSON.stringify({}), { status: 200 })
await main.run()
expect(fetchMock).toHaveBeenNthCalledWith(
1,
'https://example.com/api/v1/admin/extensions?search=ValeLS',
expect.anything()
)
expect(fetchMock).toHaveBeenNthCalledWith(
2,
'https://example.com/api/v1/admin/extensions',
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ export async function run(): Promise<void> {
const token: string = core.getInput('token')

const spec = await fs.readFile(specPath)
const asJson = jsonFromSpec(spec.toString())
const asJson = JSON.parse(jsonFromSpec(spec.toString()))

core.debug(`Parsed spec: ${JSON.stringify(asJson)}`)

if (isTest) {
// console.log(asJson)
// The following only works with secret keys etc.
return
}

await createOrUpdateExtension(
downloadUrl,
asJson as unknown as PluginMetaData,
Expand Down

0 comments on commit cdd1e68

Please sign in to comment.