mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-23 15:19:08 +02:00
fix(ci): guard all decisions behind dry-run check
Move the dry-run check to the top of the loop so it applies to all decision types, not just AUTO_CLOSE. In dry-run mode the workflow now only logs what it would do without touching any issues.
This commit is contained in:
@@ -106,19 +106,12 @@ async function setTextField(itemId, fieldId, value) {
|
|||||||
for (const d of decisions) {
|
for (const d of decisions) {
|
||||||
const [owner, repo] = d.repository.split("/");
|
const [owner, repo] = d.repository.split("/");
|
||||||
|
|
||||||
if (d.final_decision === "AUTO_CLOSE") {
|
if (dryRun) {
|
||||||
if (dryRun) {
|
console.log(`[DRY RUN] #${d.issue_number} → ${d.final_decision} (confidence: ${d.model.confidence}, reason: ${d.model.reason_code})`);
|
||||||
await addLabel(owner, repo, d.issue_number, ["resolution-candidate"]);
|
continue;
|
||||||
const issueNodeId = await getIssueNodeId(owner, repo, d.issue_number);
|
}
|
||||||
const itemId = await addToProject(issueNodeId);
|
|
||||||
if (itemId) {
|
|
||||||
await setTextField(itemId, process.env.PROJECT_REASON_FIELD_ID, `DRY_RUN:${d.model.reason_code}`);
|
|
||||||
await setTextField(itemId, process.env.PROJECT_CONFIDENCE_FIELD_ID, String(d.model.confidence));
|
|
||||||
}
|
|
||||||
console.log(`[DRY RUN] Would auto-close #${d.issue_number}`);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (d.final_decision === "AUTO_CLOSE") {
|
||||||
await addLabel(owner, repo, d.issue_number, ["auto-closed-resolved"]);
|
await addLabel(owner, repo, d.issue_number, ["auto-closed-resolved"]);
|
||||||
await addComment(owner, repo, d.issue_number, d.model.close_comment);
|
await addComment(owner, repo, d.issue_number, d.model.close_comment);
|
||||||
await closeIssue(owner, repo, d.issue_number);
|
await closeIssue(owner, repo, d.issue_number);
|
||||||
|
|||||||
Reference in New Issue
Block a user