Skip to content

Commit 2ea92c3

Browse files
committed
Update coverage badge to reflect 99.07% coverage; refactor API request body construction in main.ts for improved readability and maintainability.
1 parent ba0af8e commit 2ea92c3

4 files changed

Lines changed: 26 additions & 12 deletions

File tree

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 10 additions & 5 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.

src/main.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,19 @@ export async function run(): Promise<void> {
199199

200200
debug(`Calling SkillLens API with ${items.length} review item(s)`)
201201

202+
const requestBody = {
203+
repo: { owner, name: repo, prNumber: pr },
204+
reviews: items,
205+
defaults
206+
}
207+
208+
debug(`Request URL: ${SKILLLENS_API_URL}`)
209+
debug(`Request Method: POST`)
210+
debug(
211+
`Request Headers: Content-Type=application/json, Authorization=Bearer ${idToken.substring(0, 10)}...`
212+
)
213+
debug(`Request Body: ${JSON.stringify(requestBody, null, 2)}`)
214+
202215
let resp: Response
203216
try {
204217
resp = await fetch(SKILLLENS_API_URL, {
@@ -208,11 +221,7 @@ export async function run(): Promise<void> {
208221
Authorization: `Bearer ${idToken}`,
209222
'X-Requested-With': 'XMLHttpRequest'
210223
},
211-
body: JSON.stringify({
212-
repo: { owner, name: repo, prNumber: pr },
213-
reviews: items,
214-
defaults
215-
})
224+
body: JSON.stringify(requestBody)
216225
})
217226
} catch (fetchError) {
218227
const msg = `Network error calling SkillLens API: ${fetchError instanceof Error ? fetchError.message : String(fetchError)}`

0 commit comments

Comments
 (0)