Skip to content

Commit

Permalink
Merge pull request #28 from felixAnhalt/main
Browse files Browse the repository at this point in the history
Fix/connection (#1)
  • Loading branch information
villesau authored Dec 2, 2023
2 parents c4290da + d158a6f commit bc0dab4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const parse_diff_1 = __importDefault(__nccwpck_require__(4833));
const minimatch_1 = __importDefault(__nccwpck_require__(2002));
const GITHUB_TOKEN = core.getInput("GITHUB_TOKEN");
const OPENAI_API_KEY = core.getInput("OPENAI_API_KEY");
const OPENAI_API_MODEL = core.getInput("OPENAI_API_MODEL");
const octokit = new rest_1.Octokit({ auth: GITHUB_TOKEN });
const configuration = new openai_1.Configuration({
apiKey: OPENAI_API_KEY,
Expand Down Expand Up @@ -151,7 +152,7 @@ function getAIResponse(prompt) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () {
const queryConfig = {
model: "gpt-4",
model: OPENAI_API_MODEL,
temperature: 0.2,
max_tokens: 700,
top_p: 1,
Expand Down Expand Up @@ -210,16 +211,15 @@ function main() {
const newBaseSha = eventData.before;
const newHeadSha = eventData.after;
const response = yield octokit.repos.compareCommits({
headers: {
accept: "application/vnd.github.v3.diff",
},
owner: prDetails.owner,
repo: prDetails.repo,
base: newBaseSha,
head: newHeadSha,
});
diff = response.data.diff_url
? yield octokit
.request({ url: response.data.diff_url })
.then((res) => res.data)
: null;
diff = String(response.data);
}
else {
console.log("Unsupported event:", process.env.GITHUB_EVENT_NAME);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit bc0dab4

Please sign in to comment.