@kody-ade/kody-engine-lite 0.1.97 → 0.1.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/kody.yml +42 -0
package/package.json
CHANGED
package/templates/kody.yml
CHANGED
|
@@ -25,6 +25,9 @@ on:
|
|
|
25
25
|
issue_comment:
|
|
26
26
|
types: [created]
|
|
27
27
|
|
|
28
|
+
pull_request:
|
|
29
|
+
types: [closed]
|
|
30
|
+
|
|
28
31
|
pull_request_review:
|
|
29
32
|
types: [submitted]
|
|
30
33
|
|
|
@@ -333,6 +336,45 @@ jobs:
|
|
|
333
336
|
path: .kody/tasks/
|
|
334
337
|
retention-days: 3
|
|
335
338
|
|
|
339
|
+
# ─── Close Issue on PR Merge ────────────────────────────────────────────────
|
|
340
|
+
close-issue-on-merge:
|
|
341
|
+
if: >-
|
|
342
|
+
github.event_name == 'pull_request' &&
|
|
343
|
+
github.event.pull_request.merged == true
|
|
344
|
+
runs-on: ubuntu-latest
|
|
345
|
+
steps:
|
|
346
|
+
- name: Close linked issue
|
|
347
|
+
uses: actions/github-script@v7
|
|
348
|
+
with:
|
|
349
|
+
script: |
|
|
350
|
+
// Extract issue number from branch name (e.g. "42--feature-name")
|
|
351
|
+
const branch = context.payload.pull_request.head.ref;
|
|
352
|
+
const match = branch.match(/^(\d+)--/);
|
|
353
|
+
if (!match) return;
|
|
354
|
+
const issueNumber = parseInt(match[1], 10);
|
|
355
|
+
|
|
356
|
+
// Verify the issue exists and is open
|
|
357
|
+
try {
|
|
358
|
+
const { data: issue } = await github.rest.issues.get({
|
|
359
|
+
owner: context.repo.owner,
|
|
360
|
+
repo: context.repo.repo,
|
|
361
|
+
issue_number: issueNumber,
|
|
362
|
+
});
|
|
363
|
+
if (issue.state === 'closed') return;
|
|
364
|
+
if (issue.pull_request) return; // Skip if it's a PR, not an issue
|
|
365
|
+
|
|
366
|
+
await github.rest.issues.update({
|
|
367
|
+
owner: context.repo.owner,
|
|
368
|
+
repo: context.repo.repo,
|
|
369
|
+
issue_number: issueNumber,
|
|
370
|
+
state: 'closed',
|
|
371
|
+
state_reason: 'completed',
|
|
372
|
+
});
|
|
373
|
+
core.info(`Closed issue #${issueNumber} after PR #${context.payload.pull_request.number} was merged`);
|
|
374
|
+
} catch (e) {
|
|
375
|
+
core.warning(`Could not close issue #${issueNumber}: ${e.message}`);
|
|
376
|
+
}
|
|
377
|
+
|
|
336
378
|
# ─── Error Notifications ─────────────────────────────────────────────────────
|
|
337
379
|
notify-parse-error:
|
|
338
380
|
if: >-
|