@xn-intenton-z2a/agentic-lib 7.1.6 → 7.1.8
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/bin/agentic-lib.js
CHANGED
|
@@ -629,11 +629,31 @@ function initWorkflows() {
|
|
|
629
629
|
console.log("--- Workflows ---");
|
|
630
630
|
const workflowsDir = resolve(srcDir, "workflows");
|
|
631
631
|
if (!existsSync(workflowsDir)) return;
|
|
632
|
+
const templateWorkflows = new Set();
|
|
632
633
|
for (const f of readdirSync(workflowsDir)) {
|
|
633
634
|
if (f.endsWith(".yml")) {
|
|
635
|
+
templateWorkflows.add(f);
|
|
634
636
|
initCopyFile(resolve(workflowsDir, f), resolve(target, ".github/workflows", f), `workflows/${f}`);
|
|
635
637
|
}
|
|
636
638
|
}
|
|
639
|
+
// Also copy test.yml from seeds to workflows if it exists
|
|
640
|
+
const seedTest = resolve(srcDir, "seeds/test.yml");
|
|
641
|
+
if (existsSync(seedTest)) {
|
|
642
|
+
templateWorkflows.add("test.yml");
|
|
643
|
+
initCopyFile(seedTest, resolve(target, ".github/workflows/test.yml"), "workflows/test.yml (from seeds)");
|
|
644
|
+
}
|
|
645
|
+
// Delete stale workflows not in the template (skip init.yml — maintained by consumer)
|
|
646
|
+
const KEEP = new Set(["init.yml"]);
|
|
647
|
+
const targetWorkflowsDir = resolve(target, ".github/workflows");
|
|
648
|
+
if (existsSync(targetWorkflowsDir)) {
|
|
649
|
+
for (const f of readdirSync(targetWorkflowsDir)) {
|
|
650
|
+
if (f.endsWith(".yml") && !templateWorkflows.has(f) && !KEEP.has(f)) {
|
|
651
|
+
if (!dryRun) rmSync(resolve(targetWorkflowsDir, f));
|
|
652
|
+
console.log(` REMOVE stale: workflows/${f}`);
|
|
653
|
+
initChanges++;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
637
657
|
}
|
|
638
658
|
|
|
639
659
|
function initActions(agenticDir) {
|
package/package.json
CHANGED
|
@@ -459,7 +459,7 @@ jobs:
|
|
|
459
459
|
- uses: actions/checkout@v4
|
|
460
460
|
with:
|
|
461
461
|
fetch-depth: 0
|
|
462
|
-
ref:
|
|
462
|
+
ref: main
|
|
463
463
|
|
|
464
464
|
- name: Load config
|
|
465
465
|
id: config
|
|
@@ -473,8 +473,8 @@ jobs:
|
|
|
473
473
|
git config --local user.name '${{ env.gitUserName }}'
|
|
474
474
|
git config --local pull.ff false # never fast-forward
|
|
475
475
|
git config --local pull.rebase false # never rebase on pull
|
|
476
|
-
git fetch origin
|
|
477
|
-
git merge origin
|
|
476
|
+
git fetch origin main
|
|
477
|
+
git merge origin/main --no-ff --no-edit --strategy=recursive --strategy-option=ours
|
|
478
478
|
|
|
479
479
|
- name: log-intention-activity
|
|
480
480
|
id: log-intention-activity
|
|
@@ -539,6 +539,6 @@ jobs:
|
|
|
539
539
|
git config --local pull.rebase false # never rebase on pull
|
|
540
540
|
git add ${{ steps.config.outputs.intentionFilepath }}
|
|
541
541
|
git commit -m "Activity logged by ci-automerge.yml" || echo "No changes to commit"
|
|
542
|
-
git fetch origin
|
|
543
|
-
git merge origin
|
|
544
|
-
git push -v origin
|
|
542
|
+
git fetch origin main
|
|
543
|
+
git merge origin/main --no-ff --no-edit --strategy=recursive --strategy-option=ours
|
|
544
|
+
git push -v origin main
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# SPDX-License-Identifier: MIT
|
|
2
|
-
# Copyright (C) 2025-2026 Polycode Limited
|
|
3
|
-
# .github/workflows/ci-init.yml
|
|
4
|
-
#
|
|
5
|
-
# Pulls the latest agentic-lib infrastructure into this repository.
|
|
6
|
-
# Can optionally reset source files to the seed template state.
|
|
7
|
-
|
|
8
|
-
name: ci-init
|
|
9
|
-
run-name: "ci-init [${{ github.ref_name }}]"
|
|
10
|
-
|
|
11
|
-
on:
|
|
12
|
-
workflow_dispatch:
|
|
13
|
-
inputs:
|
|
14
|
-
purge:
|
|
15
|
-
description: "Reset source files to seed template state"
|
|
16
|
-
type: boolean
|
|
17
|
-
default: false
|
|
18
|
-
version:
|
|
19
|
-
description: "agentic-lib version to install (default: latest)"
|
|
20
|
-
type: string
|
|
21
|
-
default: "latest"
|
|
22
|
-
|
|
23
|
-
permissions:
|
|
24
|
-
contents: write
|
|
25
|
-
|
|
26
|
-
jobs:
|
|
27
|
-
init:
|
|
28
|
-
runs-on: ubuntu-latest
|
|
29
|
-
steps:
|
|
30
|
-
- uses: actions/checkout@v4
|
|
31
|
-
|
|
32
|
-
- uses: actions/setup-node@v4
|
|
33
|
-
with:
|
|
34
|
-
node-version: "24"
|
|
35
|
-
|
|
36
|
-
- name: Install agentic-lib
|
|
37
|
-
run: npm install @xn-intenton-z2a/agentic-lib@${{ inputs.version }}
|
|
38
|
-
|
|
39
|
-
- name: Run agentic-lib init
|
|
40
|
-
run: |
|
|
41
|
-
PURGE_FLAG=""
|
|
42
|
-
if [ "${{ inputs.purge }}" = "true" ]; then
|
|
43
|
-
PURGE_FLAG="--purge"
|
|
44
|
-
fi
|
|
45
|
-
npx agentic-lib init $PURGE_FLAG
|
|
46
|
-
|
|
47
|
-
- name: Install dependencies after init
|
|
48
|
-
if: inputs.purge == true
|
|
49
|
-
run: npm install
|
|
50
|
-
|
|
51
|
-
- name: Install agentic-step dependencies
|
|
52
|
-
run: |
|
|
53
|
-
cd .github/agentic-lib/actions/agentic-step
|
|
54
|
-
npm ci
|
|
55
|
-
|
|
56
|
-
- name: Verify tests pass
|
|
57
|
-
run: npm test
|
|
58
|
-
|
|
59
|
-
- name: Commit changes
|
|
60
|
-
uses: ./.github/agentic-lib/actions/commit-if-changed
|
|
61
|
-
with:
|
|
62
|
-
commit-message: "agentic-lib init${{ inputs.purge == true && ' --purge' || '' }} (v${{ inputs.version }})"
|
|
63
|
-
push-ref: ${{ github.ref_name }}
|