pipecraft 0.29.3 → 0.36.14

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.
Files changed (142) hide show
  1. package/README.md +128 -54
  2. package/dist/cli/index.d.ts +3 -3
  3. package/dist/cli/index.js +68 -25
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/generators/init.tpl.d.ts +4 -4
  6. package/dist/generators/init.tpl.d.ts.map +1 -1
  7. package/dist/generators/init.tpl.js +214 -108
  8. package/dist/generators/init.tpl.js.map +1 -1
  9. package/dist/generators/workflows.tpl.d.ts +9 -9
  10. package/dist/generators/workflows.tpl.d.ts.map +1 -1
  11. package/dist/generators/workflows.tpl.js +33 -36
  12. package/dist/generators/workflows.tpl.js.map +1 -1
  13. package/dist/templates/actions/calculate-version.yml.tpl.d.ts +7 -4
  14. package/dist/templates/actions/calculate-version.yml.tpl.d.ts.map +1 -1
  15. package/dist/templates/actions/calculate-version.yml.tpl.js +49 -23
  16. package/dist/templates/actions/calculate-version.yml.tpl.js.map +1 -1
  17. package/dist/templates/actions/create-pr.yml.tpl.d.ts +5 -2
  18. package/dist/templates/actions/create-pr.yml.tpl.d.ts.map +1 -1
  19. package/dist/templates/actions/create-pr.yml.tpl.js +14 -8
  20. package/dist/templates/actions/create-pr.yml.tpl.js.map +1 -1
  21. package/dist/templates/actions/create-release.yml.tpl.d.ts +5 -2
  22. package/dist/templates/actions/create-release.yml.tpl.d.ts.map +1 -1
  23. package/dist/templates/actions/create-release.yml.tpl.js +16 -11
  24. package/dist/templates/actions/create-release.yml.tpl.js.map +1 -1
  25. package/dist/templates/actions/create-tag.yml.tpl.d.ts +5 -2
  26. package/dist/templates/actions/create-tag.yml.tpl.d.ts.map +1 -1
  27. package/dist/templates/actions/create-tag.yml.tpl.js +13 -9
  28. package/dist/templates/actions/create-tag.yml.tpl.js.map +1 -1
  29. package/dist/templates/actions/detect-changes.yml.tpl.d.ts +17 -51
  30. package/dist/templates/actions/detect-changes.yml.tpl.d.ts.map +1 -1
  31. package/dist/templates/actions/detect-changes.yml.tpl.js +130 -110
  32. package/dist/templates/actions/detect-changes.yml.tpl.js.map +1 -1
  33. package/dist/templates/actions/manage-branch.yml.tpl.d.ts +5 -2
  34. package/dist/templates/actions/manage-branch.yml.tpl.d.ts.map +1 -1
  35. package/dist/templates/actions/manage-branch.yml.tpl.js +13 -9
  36. package/dist/templates/actions/manage-branch.yml.tpl.js.map +1 -1
  37. package/dist/templates/actions/promote-branch.yml.tpl.d.ts +5 -2
  38. package/dist/templates/actions/promote-branch.yml.tpl.d.ts.map +1 -1
  39. package/dist/templates/actions/promote-branch.yml.tpl.js +39 -92
  40. package/dist/templates/actions/promote-branch.yml.tpl.js.map +1 -1
  41. package/dist/templates/release-it.cjs.tpl.d.ts +1 -1
  42. package/dist/templates/release-it.cjs.tpl.d.ts.map +1 -1
  43. package/dist/templates/release-it.cjs.tpl.js +38 -29
  44. package/dist/templates/release-it.cjs.tpl.js.map +1 -1
  45. package/dist/templates/workflows/enforce-pr-target.yml.tpl.d.ts +1 -1
  46. package/dist/templates/workflows/enforce-pr-target.yml.tpl.d.ts.map +1 -1
  47. package/dist/templates/workflows/enforce-pr-target.yml.tpl.js +2 -3
  48. package/dist/templates/workflows/enforce-pr-target.yml.tpl.js.map +1 -1
  49. package/dist/templates/workflows/pipeline.yml.tpl.d.ts +2 -2
  50. package/dist/templates/workflows/pipeline.yml.tpl.d.ts.map +1 -1
  51. package/dist/templates/workflows/pipeline.yml.tpl.js +337 -84
  52. package/dist/templates/workflows/pipeline.yml.tpl.js.map +1 -1
  53. package/dist/templates/workflows/pr-title-check.yml.tpl.d.ts +1 -1
  54. package/dist/templates/workflows/pr-title-check.yml.tpl.d.ts.map +1 -1
  55. package/dist/templates/workflows/pr-title-check.yml.tpl.js +101 -22
  56. package/dist/templates/workflows/pr-title-check.yml.tpl.js.map +1 -1
  57. package/dist/templates/workflows/shared/index.d.ts +4 -2
  58. package/dist/templates/workflows/shared/index.d.ts.map +1 -1
  59. package/dist/templates/workflows/shared/index.js +4 -2
  60. package/dist/templates/workflows/shared/index.js.map +1 -1
  61. package/dist/templates/workflows/shared/managed-workflow.d.ts +32 -0
  62. package/dist/templates/workflows/shared/managed-workflow.d.ts.map +1 -0
  63. package/dist/templates/workflows/shared/managed-workflow.js +51 -0
  64. package/dist/templates/workflows/shared/managed-workflow.js.map +1 -0
  65. package/dist/templates/workflows/shared/operations-changes.d.ts +13 -3
  66. package/dist/templates/workflows/shared/operations-changes.d.ts.map +1 -1
  67. package/dist/templates/workflows/shared/operations-changes.js +42 -16
  68. package/dist/templates/workflows/shared/operations-changes.js.map +1 -1
  69. package/dist/templates/workflows/shared/operations-domain-jobs.d.ts +18 -1
  70. package/dist/templates/workflows/shared/operations-domain-jobs.d.ts.map +1 -1
  71. package/dist/templates/workflows/shared/operations-domain-jobs.js +142 -17
  72. package/dist/templates/workflows/shared/operations-domain-jobs.js.map +1 -1
  73. package/dist/templates/workflows/shared/operations-gate.d.ts +6 -0
  74. package/dist/templates/workflows/shared/operations-gate.d.ts.map +1 -0
  75. package/dist/templates/workflows/shared/operations-gate.js +116 -0
  76. package/dist/templates/workflows/shared/operations-gate.js.map +1 -0
  77. package/dist/templates/workflows/shared/operations-header.d.ts +11 -1
  78. package/dist/templates/workflows/shared/operations-header.d.ts.map +1 -1
  79. package/dist/templates/workflows/shared/operations-header.js +66 -7
  80. package/dist/templates/workflows/shared/operations-header.js.map +1 -1
  81. package/dist/templates/workflows/shared/operations-tag-promote.d.ts +4 -3
  82. package/dist/templates/workflows/shared/operations-tag-promote.d.ts.map +1 -1
  83. package/dist/templates/workflows/shared/operations-tag-promote.js +144 -33
  84. package/dist/templates/workflows/shared/operations-tag-promote.js.map +1 -1
  85. package/dist/templates/workflows/shared/operations-version.d.ts +3 -2
  86. package/dist/templates/workflows/shared/operations-version.d.ts.map +1 -1
  87. package/dist/templates/workflows/shared/operations-version.js +17 -16
  88. package/dist/templates/workflows/shared/operations-version.js.map +1 -1
  89. package/dist/templates/yaml-format-utils.d.ts.map +1 -1
  90. package/dist/templates/yaml-format-utils.js +1 -5
  91. package/dist/templates/yaml-format-utils.js.map +1 -1
  92. package/dist/types/index.d.ts +65 -53
  93. package/dist/types/index.d.ts.map +1 -1
  94. package/dist/utils/action-reference.d.ts +73 -0
  95. package/dist/utils/action-reference.d.ts.map +1 -0
  96. package/dist/utils/action-reference.js +120 -0
  97. package/dist/utils/action-reference.js.map +1 -0
  98. package/dist/utils/ast-path-operations.d.ts +3 -3
  99. package/dist/utils/ast-path-operations.d.ts.map +1 -1
  100. package/dist/utils/ast-path-operations.js +58 -17
  101. package/dist/utils/ast-path-operations.js.map +1 -1
  102. package/dist/utils/config.d.ts +16 -5
  103. package/dist/utils/config.d.ts.map +1 -1
  104. package/dist/utils/config.js +69 -12
  105. package/dist/utils/config.js.map +1 -1
  106. package/dist/utils/github-setup.d.ts +7 -7
  107. package/dist/utils/github-setup.d.ts.map +1 -1
  108. package/dist/utils/github-setup.js +84 -63
  109. package/dist/utils/github-setup.js.map +1 -1
  110. package/dist/utils/logger.d.ts.map +1 -1
  111. package/dist/utils/logger.js.map +1 -1
  112. package/dist/utils/messaging.d.ts +2 -2
  113. package/dist/utils/messaging.d.ts.map +1 -1
  114. package/dist/utils/messaging.js +12 -8
  115. package/dist/utils/messaging.js.map +1 -1
  116. package/dist/utils/preflight.d.ts +2 -2
  117. package/dist/utils/preflight.d.ts.map +1 -1
  118. package/dist/utils/preflight.js +43 -41
  119. package/dist/utils/preflight.js.map +1 -1
  120. package/dist/utils/versioning.d.ts +1 -1
  121. package/dist/utils/versioning.d.ts.map +1 -1
  122. package/dist/utils/versioning.js +10 -10
  123. package/dist/utils/versioning.js.map +1 -1
  124. package/dist/utils/workflow-semantics.d.ts +61 -0
  125. package/dist/utils/workflow-semantics.d.ts.map +1 -0
  126. package/dist/utils/workflow-semantics.js +230 -0
  127. package/dist/utils/workflow-semantics.js.map +1 -0
  128. package/package.json +12 -4
  129. package/src/generators/init.tpl.ts +275 -128
  130. package/src/generators/workflows.tpl.ts +54 -57
  131. package/dist/templates/actions/detect-changes-nx.yml.tpl.d.ts +0 -32
  132. package/dist/templates/actions/detect-changes-nx.yml.tpl.d.ts.map +0 -1
  133. package/dist/templates/actions/detect-changes-nx.yml.tpl.js +0 -227
  134. package/dist/templates/actions/detect-changes-nx.yml.tpl.js.map +0 -1
  135. package/dist/templates/workflows/pipeline-nx.yml.tpl.d.ts +0 -22
  136. package/dist/templates/workflows/pipeline-nx.yml.tpl.d.ts.map +0 -1
  137. package/dist/templates/workflows/pipeline-nx.yml.tpl.js +0 -196
  138. package/dist/templates/workflows/pipeline-nx.yml.tpl.js.map +0 -1
  139. package/dist/utils/idempotency.d.ts +0 -187
  140. package/dist/utils/idempotency.d.ts.map +0 -1
  141. package/dist/utils/idempotency.js +0 -304
  142. package/dist/utils/idempotency.js.map +0 -1
@@ -1,100 +1,45 @@
1
1
  /**
2
2
  * Detect Changes Action Template
3
3
  *
4
- * Generates a GitHub composite action that detects which domains (application areas)
5
- * have changes in a pull request. This is the foundation for PipeCraft's path-based
6
- * conditional workflow execution.
4
+ * Generates a REUSABLE GitHub composite action that detects which domains have changed
5
+ * using path-based change detection with dorny/paths-filter.
7
6
  *
8
7
  * ## Purpose
9
8
  *
10
- * In monorepos or multi-domain projects, not every change affects every part of the
11
- * system. This action uses GitHub's `dorny/paths-filter` to detect which domains
12
- * have modifications, allowing subsequent jobs to run conditionally.
9
+ * This action is **configuration-driven** and accepts domain definitions as YAML input,
10
+ * making it truly reusable across any project without regeneration.
11
+ * It uses path filters to detect which domains changed based on file glob patterns.
13
12
  *
14
- * ## How It Works
13
+ * ## Key Design Principle
15
14
  *
16
- * 1. Checks out the repository with full history
17
- * 2. Uses paths-filter action to check each domain's file patterns
18
- * 3. Outputs a boolean for each domain (true if changed, false if not)
19
- * 4. Logs results for debugging
15
+ * **Domains are passed as input, not hardcoded in the action.**
16
+ * This allows the same action to work with any domain configuration without regeneration.
20
17
  *
21
18
  * ## Generated Action Location
22
19
  *
23
- * `.github/actions/detect-changes/action.yml`
24
- *
25
- * ## Usage in Workflows
26
- *
27
- * ```yaml
28
- * jobs:
29
- * changes:
30
- * runs-on: ubuntu-latest
31
- * outputs:
32
- * api: ${{ steps.changes.outputs.api }}
33
- * web: ${{ steps.changes.outputs.web }}
34
- * steps:
35
- * - uses: ./.github/actions/detect-changes
36
- * id: changes
37
- * with:
38
- * baseRef: main
39
- *
40
- * test-api:
41
- * needs: changes
42
- * if: needs.changes.outputs.api == 'true'
43
- * # Only runs if API domain changed
44
- * ```
20
+ * `actions/detect-changes/action.yml`
45
21
  *
46
22
  * @module templates/actions/detect-changes.yml.tpl
47
23
  */
48
- import { toFile, renderTemplate } from '@featherscloud/pinion';
24
+ import { renderTemplate, toFile } from '@featherscloud/pinion';
49
25
  import fs from 'fs';
50
26
  import { logger } from '../../utils/logger.js';
27
+ import { getActionOutputDir, shouldGenerateActions } from '../../utils/action-reference.js';
51
28
  /**
52
29
  * Generates the detect-changes composite action YAML content.
53
30
  *
54
31
  * Creates a GitHub Actions composite action that:
55
- * - Accepts a base branch reference for comparison
56
- * - Defines outputs for each configured domain
57
- * - Uses dorny/paths-filter to detect file changes
58
- * - Merges filter outputs into domain-specific outputs
59
- * - Logs detection results
32
+ * - Accepts domain configuration as YAML input (not hardcoded)
33
+ * - Dynamically parses domains using yq or grep fallback
34
+ * - Uses dorny/paths-filter for path-based change detection
35
+ * - Outputs individual domain results AND a JSON summary
60
36
  *
61
- * @param {any} ctx - Context containing domains configuration
62
- * @param {Record<string, DomainConfig>} ctx.domains - Domain configurations with path patterns
37
+ * @param {any} ctx - Context (not used - action is fully dynamic now)
63
38
  * @returns {string} YAML content for the composite action
64
- *
65
- * @example
66
- * ```typescript
67
- * const yaml = changesActionTemplate({
68
- * domains: {
69
- * api: { paths: ['src/api/**'] },
70
- * web: { paths: ['src/web/**'] }
71
- * }
72
- * })
73
- * // Generates action with 'api' and 'web' outputs
74
- * ```
75
39
  */
76
40
  const changesActionTemplate = (ctx) => {
77
- const domainOutputs = Object.entries(ctx.domains).map((entry) => {
78
- const [domainName, domainConfig] = entry;
79
- return ` ${domainName}:
80
- description: 'Whether ${domainName} domain has changes'
81
- value: \${{ steps.merge.outputs.${domainName} }}`;
82
- }).join('\n');
83
- const domainFilters = Object.entries(ctx.domains).map((entry) => {
84
- const [domainName, domainConfig] = entry;
85
- return ` ${domainName}:\n - '${domainConfig.paths.join("'\\n - '")}'`;
86
- }).join('\n');
87
- const domainEchoes = Object.entries(ctx.domains).map((entry) => {
88
- const [domainName, domainConfig] = entry;
89
- return ` echo "${domainName}=\${{ contains(steps.filter.outputs.changes, '${domainName}') }}" >> $GITHUB_OUTPUT`;
90
- }).join('\n');
91
- const domainResults = Object.entries(ctx.domains).map((entry) => {
92
- const [domainName, domainConfig] = entry;
93
- return ` echo " ${domainName}: \${{ contains(steps.filter.outputs.changes, '${domainName}') }}"`;
94
- }).join('\n');
95
- // Generate the composite action YAML
96
- return `name: 'Detect Changes'
97
- description: 'Detect changes in different application domains based on file paths'
41
+ return `name: 'Detect Changes (Configuration-Driven)'
42
+ description: 'Path-based change detection using dorny/paths-filter. Accepts domain configuration as YAML input.'
98
43
  author: 'Pipecraft'
99
44
 
100
45
  inputs:
@@ -102,18 +47,21 @@ inputs:
102
47
  description: 'Base reference to compare against'
103
48
  required: false
104
49
  default: 'main'
50
+ domains-config:
51
+ description: 'YAML string of domain configurations (embedded in pipeline at generation time)'
52
+ required: true
105
53
 
106
54
  outputs:
107
- ${domainOutputs}
55
+ changes:
56
+ description: 'JSON object with domain change results (e.g., {"core": true, "docs": false})'
57
+ value: \${{ steps.output.outputs.changes }}
58
+ affectedDomains:
59
+ description: 'Comma-separated list of domains with changes'
60
+ value: \${{ steps.output.outputs.affectedDomains }}
108
61
 
109
62
  runs:
110
63
  using: 'composite'
111
64
  steps:
112
- - name: Checkout Code
113
- uses: actions/checkout@v4
114
- with:
115
- fetch-depth: 0
116
-
117
65
  - name: Set Base Branch
118
66
  id: set-base
119
67
  shell: bash
@@ -122,54 +70,126 @@ runs:
122
70
  echo "base_branch=$base_branch" >> $GITHUB_OUTPUT
123
71
  echo "base_branch=$base_branch" >> $GITHUB_ENV
124
72
 
125
- - name: Detect Changes
73
+ - name: Parse Domain Configuration
74
+ id: parse-domains
75
+ shell: bash
76
+ run: |
77
+ # Parse the domains-config YAML input (embedded in pipeline at generation time)
78
+ echo "\${{ inputs.domains-config }}" > /tmp/domains-config.yml
79
+
80
+ # Extract domain names using yq (or fallback to grep/awk)
81
+ if command -v yq >/dev/null 2>&1; then
82
+ DOMAIN_NAMES=$(yq eval 'keys | join(",")' /tmp/domains-config.yml)
83
+ else
84
+ # Fallback: extract domain names without yq
85
+ DOMAIN_NAMES=$(grep -E '^[[:space:]]*[a-zA-Z0-9_-]+:' /tmp/domains-config.yml | sed 's/[[:space:]]*\\(.*\\):.*/\\1/' | tr '\\n' ',' | sed 's/,$//')
86
+ fi
87
+
88
+ echo "domains=$DOMAIN_NAMES" >> $GITHUB_OUTPUT
89
+ echo "📋 Configured domains: $DOMAIN_NAMES"
90
+
91
+ - name: Transform Domain Config for Paths Filter
92
+ id: transform-config
93
+ shell: bash
94
+ run: |
95
+ # Transform domains-config from PipeCraft format to paths-filter format
96
+ # PipeCraft format: domain: { paths: [...] }
97
+ # paths-filter format: domain: [...]
98
+
99
+ # Read the domains config
100
+ cat /tmp/domains-config.yml
101
+
102
+ # Transform: remove 'paths:' lines and unindent the glob patterns
103
+ sed '/paths:/d' /tmp/domains-config.yml | sed 's/^ -/-/' > /tmp/paths-filter-config.yml
104
+
105
+ echo ""
106
+ echo "Transformed for paths-filter:"
107
+ cat /tmp/paths-filter-config.yml
108
+
109
+ # Store as output for use in paths-filter
110
+ {
111
+ echo "filters<<EOF"
112
+ cat /tmp/paths-filter-config.yml
113
+ echo "EOF"
114
+ } >> $GITHUB_OUTPUT
115
+
116
+ - name: Detect Changes with Paths Filter
126
117
  uses: dorny/paths-filter@v3
127
118
  id: filter
128
119
  with:
129
120
  base: \${{ steps.set-base.outputs.base_branch }}
130
- filters: |
131
- ${domainFilters}
121
+ filters: \${{ steps.transform-config.outputs.filters }}
132
122
 
133
- - name: Merge filter outputs
134
- id: merge
123
+ - name: Generate Outputs
124
+ id: output
135
125
  shell: bash
136
126
  run: |
137
- ${domainEchoes}
138
-
127
+ echo "📁 Using path-based change detection"
128
+ echo "{" > /tmp/path-results.json
129
+
130
+ IFS=',' read -ra DOMAIN_NAMES <<< "\${{ steps.parse-domains.outputs.domains }}"
131
+ FIRST=true
132
+ for domain in "\${DOMAIN_NAMES[@]}"; do
133
+ domain=$(echo "$domain" | xargs)
134
+ if [ "$FIRST" = true ]; then
135
+ FIRST=false
136
+ else
137
+ echo "," >> /tmp/path-results.json
138
+ fi
139
+
140
+ # Check if domain appears in filter changes
141
+ if echo "\${{ steps.filter.outputs.changes }}" | grep -q "$domain"; then
142
+ echo " \\"$domain\\": true" >> /tmp/path-results.json
143
+ else
144
+ echo " \\"$domain\\": false" >> /tmp/path-results.json
145
+ fi
146
+ done
147
+ echo "}" >> /tmp/path-results.json
148
+
149
+ CHANGES_JSON=$(cat /tmp/path-results.json)
150
+
151
+ # Output the JSON
152
+ echo "changes<<EOF" >> $GITHUB_OUTPUT
153
+ echo "$CHANGES_JSON" >> $GITHUB_OUTPUT
154
+ echo "EOF" >> $GITHUB_OUTPUT
155
+
156
+ # Build comma-separated list of affected domains (using node instead of jq for portability)
157
+ AFFECTED_DOMAINS=$(node -e "
158
+ const data = JSON.parse(process.argv[1]);
159
+ const affected = Object.entries(data)
160
+ .filter(([_, v]) => v === true)
161
+ .map(([k]) => k)
162
+ .join(',');
163
+ console.log(affected);
164
+ " "$CHANGES_JSON")
165
+ echo "affectedDomains=$AFFECTED_DOMAINS" >> $GITHUB_OUTPUT
166
+
139
167
  echo "📋 Change Detection Results:"
140
- ${domainResults}`;
168
+ node -e "console.log(JSON.stringify(JSON.parse(process.argv[1]), null, 2))" "$CHANGES_JSON"
169
+ echo "🎯 Affected domains: $AFFECTED_DOMAINS"
170
+ `;
141
171
  };
142
172
  /**
143
173
  * Generator entry point for detect-changes composite action.
144
174
  *
145
- * Generates the `.github/actions/detect-changes/action.yml` file with domain-specific
146
- * change detection logic. This action is used by the main pipeline to determine which
147
- * domains have changes and need to run tests/deployment.
175
+ * Generates the \`actions/detect-changes/action.yml\` file with configuration-driven
176
+ * change detection logic. This action accepts domain configuration as input at runtime,
177
+ * making it truly reusable without regeneration.
148
178
  *
149
179
  * @param {PinionContext} ctx - Pinion generator context
150
- * @param {Record<string, DomainConfig>} ctx.domains - Domain configurations
151
180
  * @returns {Promise<PinionContext>} Updated context after file generation
152
- *
153
- * @example
154
- * ```typescript
155
- * await generate({
156
- * cwd: '/path/to/project',
157
- * domains: {
158
- * api: { paths: ['src/api/**'], description: 'API' },
159
- * web: { paths: ['src/web/**'], description: 'Web' }
160
- * }
161
- * })
162
- * // Creates: .github/actions/detect-changes/action.yml
163
- * ```
164
181
  */
165
- export const generate = (ctx) => Promise.resolve(ctx)
166
- .then((ctx) => {
167
- // Check if file exists to determine merge status
168
- const filePath = '.github/actions/detect-changes/action.yml';
182
+ export const generate = (ctx) => Promise.resolve(ctx).then(ctx => {
183
+ const config = ctx.config || {};
184
+ if (!shouldGenerateActions(config)) {
185
+ logger.verbose('Skipping detect-changes action generation (using remote actions)');
186
+ return ctx;
187
+ }
188
+ const outputDir = getActionOutputDir(config);
189
+ const filePath = `${outputDir}/detect-changes/action.yml`;
169
190
  const exists = fs.existsSync(filePath);
170
191
  const status = exists ? '🔄 Merged with existing' : '📝 Created new';
171
192
  logger.verbose(`${status} ${filePath}`);
172
- return ctx;
173
- })
174
- .then(renderTemplate(changesActionTemplate, toFile('.github/actions/detect-changes/action.yml')));
193
+ return renderTemplate(changesActionTemplate, toFile(filePath))(ctx);
194
+ });
175
195
  //# sourceMappingURL=detect-changes.yml.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"detect-changes.yml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AE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AACrE,CAAC,CAAC,CAAA"}
@@ -6,12 +6,15 @@
6
6
  *
7
7
  * @module templates/actions/manage-branch.yml.tpl
8
8
  */
9
- import { PinionContext } from '@featherscloud/pinion';
9
+ import { type PinionContext } from '@featherscloud/pinion';
10
+ import type { PipecraftConfig } from '../../types/index.js';
10
11
  /**
11
12
  * Generator entry point for manage-branch composite action.
12
13
  *
13
14
  * @param {PinionContext} ctx - Pinion generator context
14
15
  * @returns {Promise<PinionContext>} Updated context after file generation
15
16
  */
16
- export declare const generate: (ctx: PinionContext) => Promise<any>;
17
+ export declare const generate: (ctx: PinionContext & {
18
+ config?: Partial<PipecraftConfig>;
19
+ }) => Promise<any>;
17
20
  //# sourceMappingURL=manage-branch.yml.tpl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"manage-branch.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/manage-branch.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AA+H7E;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,iBAUwD,CAAA"}
1
+ {"version":3,"file":"manage-branch.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/manage-branch.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AAKlF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AA4H3D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAAE,iBAgB/E,CAAA"}
@@ -6,10 +6,11 @@
6
6
  *
7
7
  * @module templates/actions/manage-branch.yml.tpl
8
8
  */
9
- import { toFile, renderTemplate } from '@featherscloud/pinion';
10
- import fs from 'fs';
9
+ import { renderTemplate, toFile } from '@featherscloud/pinion';
11
10
  import dedent from 'dedent';
11
+ import fs from 'fs';
12
12
  import { logger } from '../../utils/logger.js';
13
+ import { getActionOutputDir, shouldGenerateActions } from '../../utils/action-reference.js';
13
14
  /**
14
15
  * Generates the manage-branch composite action YAML content.
15
16
  *
@@ -137,14 +138,17 @@ const branchActionTemplate = (ctx) => {
137
138
  * @param {PinionContext} ctx - Pinion generator context
138
139
  * @returns {Promise<PinionContext>} Updated context after file generation
139
140
  */
140
- export const generate = (ctx) => Promise.resolve(ctx)
141
- .then((ctx) => {
142
- // Check if file exists to determine merge status
143
- const filePath = '.github/actions/manage-branch/action.yml';
141
+ export const generate = (ctx) => Promise.resolve(ctx).then(ctx => {
142
+ const config = ctx.config || {};
143
+ if (!shouldGenerateActions(config)) {
144
+ logger.verbose('Skipping manage-branch action generation (using remote actions)');
145
+ return ctx;
146
+ }
147
+ const outputDir = getActionOutputDir(config);
148
+ const filePath = `${outputDir}/manage-branch/action.yml`;
144
149
  const exists = fs.existsSync(filePath);
145
150
  const status = exists ? '🔄 Merged with existing' : '📝 Created new';
146
151
  logger.verbose(`${status} ${filePath}`);
147
- return ctx;
148
- })
149
- .then(renderTemplate(branchActionTemplate, toFile('.github/actions/manage-branch/action.yml')));
152
+ return renderTemplate(branchActionTemplate, toFile(filePath))(ctx);
153
+ });
150
154
  //# sourceMappingURL=manage-branch.yml.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"manage-branch.yml.tpl.js","sourceRoot":"","sources":["../../../src/templates/actions/manage-branch.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiB,MAAM,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM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,CAAA;AAG3F;;;;;GAKG;AACH,MAAM,oBAAoB,GAAG,CAAC,GAAQ,EAAE,EAAE;IACxC,OAAO,MAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAgHA,CAAA;AACf,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAA0D,EAAE,EAAE,CACrF,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;IAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,EAAE,CAAA;IAE/B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC;QACnC,MAAM,CAAC,OAAO,CAAC,iEAAiE,CAAC,CAAA;QACjF,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAA;IAC5C,MAAM,QAAQ,GAAG,GAAG,SAAS,2BAA2B,CAAA;IACxD,MAAM,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,gBAAgB,CAAA;IACpE,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAA;IAEvC,OAAO,cAAc,CAAC,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AACpE,CAAC,CAAC,CAAA"}
@@ -6,12 +6,15 @@
6
6
  *
7
7
  * @module templates/actions/promote-branch.yml.tpl
8
8
  */
9
- import { PinionContext } from '@featherscloud/pinion';
9
+ import { type PinionContext } from '@featherscloud/pinion';
10
+ import type { PipecraftConfig } from '../../types/index.js';
10
11
  /**
11
12
  * Generator entry point for promote-branch composite action.
12
13
  *
13
14
  * @param {PinionContext} ctx - Pinion generator context
14
15
  * @returns {Promise<PinionContext>} Updated context after file generation
15
16
  */
16
- export declare const generate: (ctx: PinionContext) => Promise<any>;
17
+ export declare const generate: (ctx: PinionContext & {
18
+ config?: Partial<PipecraftConfig>;
19
+ }) => Promise<any>;
17
20
  //# sourceMappingURL=promote-branch.yml.tpl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"promote-branch.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/promote-branch.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AA8X7E;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,iBAUgE,CAAA"}
1
+ {"version":3,"file":"promote-branch.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/promote-branch.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AAKlF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAkU3D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAAE,iBAgB/E,CAAA"}