Skip to content

Commit bc0dab4

Browse files
authored
Merge pull request #28 from felixAnhalt/main
Fix/connection (#1)
2 parents c4290da + d158a6f commit bc0dab4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

dist/index.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const parse_diff_1 = __importDefault(__nccwpck_require__(4833));
5050
const minimatch_1 = __importDefault(__nccwpck_require__(2002));
5151
const GITHUB_TOKEN = core.getInput("GITHUB_TOKEN");
5252
const OPENAI_API_KEY = core.getInput("OPENAI_API_KEY");
53+
const OPENAI_API_MODEL = core.getInput("OPENAI_API_MODEL");
5354
const octokit = new rest_1.Octokit({ auth: GITHUB_TOKEN });
5455
const configuration = new openai_1.Configuration({
5556
apiKey: OPENAI_API_KEY,
@@ -151,7 +152,7 @@ function getAIResponse(prompt) {
151152
var _a, _b;
152153
return __awaiter(this, void 0, void 0, function* () {
153154
const queryConfig = {
154-
model: "gpt-4",
155+
model: OPENAI_API_MODEL,
155156
temperature: 0.2,
156157
max_tokens: 700,
157158
top_p: 1,
@@ -210,16 +211,15 @@ function main() {
210211
const newBaseSha = eventData.before;
211212
const newHeadSha = eventData.after;
212213
const response = yield octokit.repos.compareCommits({
214+
headers: {
215+
accept: "application/vnd.github.v3.diff",
216+
},
213217
owner: prDetails.owner,
214218
repo: prDetails.repo,
215219
base: newBaseSha,
216220
head: newHeadSha,
217221
});
218-
diff = response.data.diff_url
219-
? yield octokit
220-
.request({ url: response.data.diff_url })
221-
.then((res) => res.data)
222-
: null;
222+
diff = String(response.data);
223223
}
224224
else {
225225
console.log("Unsupported event:", process.env.GITHUB_EVENT_NAME);

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)