Fix/connection (#1)

* stuff

* stuff
This commit is contained in:
Felix Anhalt 2023-11-27 14:15:48 +01:00 committed by GitHub
parent c4290da204
commit d158a6fdbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

12
dist/index.js vendored

@ -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,
@ -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,
@ -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);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long