mirror of
https://github.com/mshick/add-pr-comment.git
synced 2025-12-31 14:20:32 +11:00
fix: proper response parsing
This commit is contained in:
parent
1936bc3fe4
commit
25edbf78f2
2 changed files with 2 additions and 6 deletions
4
dist/index.js
vendored
4
dist/index.js
vendored
|
|
@ -1999,13 +1999,11 @@ const getPulls = async (repoToken, repo, commitSha) => {
|
||||||
[Headers.Authorization]: `token ${repoToken}`,
|
[Headers.Authorization]: `token ${repoToken}`,
|
||||||
};
|
};
|
||||||
|
|
||||||
const response = await http.getJson(
|
const body = await http.getJson(
|
||||||
`https://api.github.com/repos/${repo}/commits/${commitSha}/pulls`,
|
`https://api.github.com/repos/${repo}/commits/${commitSha}/pulls`,
|
||||||
additionalHeaders
|
additionalHeaders
|
||||||
);
|
);
|
||||||
|
|
||||||
const body = await response.readBody();
|
|
||||||
|
|
||||||
core.debug(JSON.stringify(body));
|
core.debug(JSON.stringify(body));
|
||||||
|
|
||||||
return body;
|
return body;
|
||||||
|
|
|
||||||
4
index.js
4
index.js
|
|
@ -12,13 +12,11 @@ const getPulls = async (repoToken, repo, commitSha) => {
|
||||||
[Headers.Authorization]: `token ${repoToken}`,
|
[Headers.Authorization]: `token ${repoToken}`,
|
||||||
};
|
};
|
||||||
|
|
||||||
const response = await http.getJson(
|
const body = await http.getJson(
|
||||||
`https://api.github.com/repos/${repo}/commits/${commitSha}/pulls`,
|
`https://api.github.com/repos/${repo}/commits/${commitSha}/pulls`,
|
||||||
additionalHeaders
|
additionalHeaders
|
||||||
);
|
);
|
||||||
|
|
||||||
const body = await response.readBody();
|
|
||||||
|
|
||||||
core.debug(JSON.stringify(body));
|
core.debug(JSON.stringify(body));
|
||||||
|
|
||||||
return body;
|
return body;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue