mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-11-17 00:00:02 +01:00
Merge branch 'dev/pr_automation_5' into dev/test_pr_automation_5
This commit is contained in:
commit
05ce84fcfa
2 files changed
+21
-29
No files matched your search
@@ -159,7 +159,7 @@ jobs:
|
||||
pull-requests: write
|
||||
contents: read
|
||||
issues: write
|
||||
models: read
|
||||
copilot-requests: write
|
||||
|
||||
file-version:
|
||||
needs:
|
||||
|
||||
@@ -20,7 +20,7 @@ permissions:
|
||||
pull-requests: write
|
||||
contents: read
|
||||
issues: write
|
||||
models: read
|
||||
copilot-requests: write
|
||||
|
||||
jobs:
|
||||
check-release-notes:
|
||||
@@ -328,38 +328,30 @@ jobs:
|
||||
].join('\n');
|
||||
|
||||
try {
|
||||
const response = await fetch(
|
||||
'https://models.github.ai/inference/chat/completions',
|
||||
const { execFile } = require('child_process');
|
||||
const { promisify } = require('util');
|
||||
const execFileAsync = promisify(execFile);
|
||||
|
||||
const { stdout } = await execFileAsync(
|
||||
'copilot',
|
||||
[
|
||||
'-p',
|
||||
prompt,
|
||||
'-s',
|
||||
'--no-ask-user',
|
||||
'--model',
|
||||
'gpt-4.1-mini'
|
||||
],
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
|
||||
'Content-Type': 'application/json'
|
||||
env: {
|
||||
...process.env,
|
||||
GITHUB_TOKEN: process.env.GITHUB_TOKEN
|
||||
},
|
||||
body: JSON.stringify({
|
||||
model: 'openai/gpt-4.1-mini',
|
||||
messages: [
|
||||
{
|
||||
role: 'system',
|
||||
content: 'You write concise, technical release notes for scientific detector software.'
|
||||
},
|
||||
{
|
||||
role: 'user',
|
||||
content: prompt
|
||||
}
|
||||
],
|
||||
temperature: 0.2,
|
||||
max_tokens: 500
|
||||
})
|
||||
maxBuffer: 1024 * 1024
|
||||
}
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`AI request failed with status ${response.status}`);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
const aiText = data?.choices?.[0]?.message?.content?.trim();
|
||||
const aiText = stdout.trim();
|
||||
|
||||
if (!aiText) {
|
||||
throw new Error('AI response did not contain message content.');
|
||||
|
||||
Reference in new issue
Block a user