pipecraft 0.0.0-releaseit

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 (176) hide show
  1. package/.claude/settings.local.json +35 -0
  2. package/.github/actions/calculate-version/action.yml +106 -0
  3. package/.github/actions/create-pr/action.yml +122 -0
  4. package/.github/actions/create-release/action.yml +74 -0
  5. package/.github/actions/create-tag/action.yml +94 -0
  6. package/.github/actions/detect-changes/action.yml +62 -0
  7. package/.github/actions/manage-branch/action.yml +113 -0
  8. package/.github/actions/promote-branch/action.yml +352 -0
  9. package/.github/example/workflows/job.analyze.code.yml +26 -0
  10. package/.github/example/workflows/job.analyze.docker.yml +32 -0
  11. package/.github/example/workflows/job.app.api.deploy.yml +127 -0
  12. package/.github/example/workflows/job.app.api.test.yml +102 -0
  13. package/.github/example/workflows/job.app.docs.deploy.yml +40 -0
  14. package/.github/example/workflows/job.app.docs.test.yml +50 -0
  15. package/.github/example/workflows/job.app.web.deploy.yml +96 -0
  16. package/.github/example/workflows/job.app.web.test.yml +49 -0
  17. package/.github/example/workflows/job.changes.yml +82 -0
  18. package/.github/example/workflows/job.create-pr.yml +96 -0
  19. package/.github/example/workflows/job.env-check.yml +43 -0
  20. package/.github/example/workflows/job.fast-forward.yml +103 -0
  21. package/.github/example/workflows/job.lint.yml +64 -0
  22. package/.github/example/workflows/job.pr-name.yml +70 -0
  23. package/.github/example/workflows/job.pr-squash-name.yml +27 -0
  24. package/.github/example/workflows/job.tag.yml +38 -0
  25. package/.github/example/workflows/job.version.yml +99 -0
  26. package/.github/example/workflows/lib.plugin-base.publish.yml +59 -0
  27. package/.github/example/workflows/pipe.yml +178 -0
  28. package/.github/example/workflows/scripts/fastforward.sh +51 -0
  29. package/.github/example/workflows/scripts/pipe-cleaner.sh +70 -0
  30. package/.github/scripts/fastforward.sh +51 -0
  31. package/.github/scripts/pipe-cleaner.sh +70 -0
  32. package/.github/workflows/pipeline.yml +220 -0
  33. package/.github/workflows/pr-title-check.yml +70 -0
  34. package/.github/workflows/publish.yml +39 -0
  35. package/.pipecraftrc.json +78 -0
  36. package/.release-it.cjs +71 -0
  37. package/PIPELINE_TESTING_PLAN.md +499 -0
  38. package/README.md +1101 -0
  39. package/TRUNK_FLOW_PLAN.md +401 -0
  40. package/assets/logo_banner.png +0 -0
  41. package/assets/logo_banner.webp +0 -0
  42. package/dist/cli/index.d.ts +3 -0
  43. package/dist/cli/index.d.ts.map +1 -0
  44. package/dist/cli/index.js +364 -0
  45. package/dist/cli/index.js.map +1 -0
  46. package/dist/generators/init.tpl.d.ts +3 -0
  47. package/dist/generators/init.tpl.d.ts.map +1 -0
  48. package/dist/generators/init.tpl.js +117 -0
  49. package/dist/generators/init.tpl.js.map +1 -0
  50. package/dist/generators/workflows.tpl.d.ts +7 -0
  51. package/dist/generators/workflows.tpl.d.ts.map +1 -0
  52. package/dist/generators/workflows.tpl.js +73 -0
  53. package/dist/generators/workflows.tpl.js.map +1 -0
  54. package/dist/templates/actions/calculate-version.yml.tpl.d.ts +3 -0
  55. package/dist/templates/actions/calculate-version.yml.tpl.d.ts.map +1 -0
  56. package/dist/templates/actions/calculate-version.yml.tpl.js +122 -0
  57. package/dist/templates/actions/calculate-version.yml.tpl.js.map +1 -0
  58. package/dist/templates/actions/create-pr.yml.tpl.d.ts +3 -0
  59. package/dist/templates/actions/create-pr.yml.tpl.d.ts.map +1 -0
  60. package/dist/templates/actions/create-pr.yml.tpl.js +145 -0
  61. package/dist/templates/actions/create-pr.yml.tpl.js.map +1 -0
  62. package/dist/templates/actions/create-tag.yml.tpl.d.ts +3 -0
  63. package/dist/templates/actions/create-tag.yml.tpl.d.ts.map +1 -0
  64. package/dist/templates/actions/create-tag.yml.tpl.js +111 -0
  65. package/dist/templates/actions/create-tag.yml.tpl.js.map +1 -0
  66. package/dist/templates/actions/detect-changes.yml.tpl.d.ts +3 -0
  67. package/dist/templates/actions/detect-changes.yml.tpl.d.ts.map +1 -0
  68. package/dist/templates/actions/detect-changes.yml.tpl.js +79 -0
  69. package/dist/templates/actions/detect-changes.yml.tpl.js.map +1 -0
  70. package/dist/templates/actions/manage-branch.yml.tpl.d.ts +3 -0
  71. package/dist/templates/actions/manage-branch.yml.tpl.d.ts.map +1 -0
  72. package/dist/templates/actions/manage-branch.yml.tpl.js +130 -0
  73. package/dist/templates/actions/manage-branch.yml.tpl.js.map +1 -0
  74. package/dist/templates/actions/promote-branch.yml.tpl.d.ts +3 -0
  75. package/dist/templates/actions/promote-branch.yml.tpl.d.ts.map +1 -0
  76. package/dist/templates/actions/promote-branch.yml.tpl.js +362 -0
  77. package/dist/templates/actions/promote-branch.yml.tpl.js.map +1 -0
  78. package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts +16 -0
  79. package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts.map +1 -0
  80. package/dist/templates/workflows/pipeline-path-based.yml.tpl.js +652 -0
  81. package/dist/templates/workflows/pipeline-path-based.yml.tpl.js.map +1 -0
  82. package/dist/types/index.d.ts +63 -0
  83. package/dist/types/index.d.ts.map +1 -0
  84. package/dist/types/index.js +2 -0
  85. package/dist/types/index.js.map +1 -0
  86. package/dist/utils/ast-path-operations.d.ts +287 -0
  87. package/dist/utils/ast-path-operations.d.ts.map +1 -0
  88. package/dist/utils/ast-path-operations.js +419 -0
  89. package/dist/utils/ast-path-operations.js.map +1 -0
  90. package/dist/utils/config.d.ts +3 -0
  91. package/dist/utils/config.d.ts.map +1 -0
  92. package/dist/utils/config.js +49 -0
  93. package/dist/utils/config.js.map +1 -0
  94. package/dist/utils/github-setup.d.ts +74 -0
  95. package/dist/utils/github-setup.d.ts.map +1 -0
  96. package/dist/utils/github-setup.js +418 -0
  97. package/dist/utils/github-setup.js.map +1 -0
  98. package/dist/utils/idempotency.d.ts +47 -0
  99. package/dist/utils/idempotency.d.ts.map +1 -0
  100. package/dist/utils/idempotency.js +176 -0
  101. package/dist/utils/idempotency.js.map +1 -0
  102. package/dist/utils/preflight.d.ts +55 -0
  103. package/dist/utils/preflight.d.ts.map +1 -0
  104. package/dist/utils/preflight.js +261 -0
  105. package/dist/utils/preflight.js.map +1 -0
  106. package/dist/utils/versioning.d.ts +41 -0
  107. package/dist/utils/versioning.d.ts.map +1 -0
  108. package/dist/utils/versioning.js +219 -0
  109. package/dist/utils/versioning.js.map +1 -0
  110. package/docs/USER_JOURNEY_ERRORS.md +352 -0
  111. package/eslint.config.js +77 -0
  112. package/examples/basic-config.json +41 -0
  113. package/examples/monorepo-config.json +49 -0
  114. package/examples/usage.md +289 -0
  115. package/package.json +58 -0
  116. package/scripts/debug-workflows.sh +339 -0
  117. package/scripts/parse-pipeline.js +29 -0
  118. package/scripts/test-job-order.cjs +140 -0
  119. package/scripts/validate-pipeline.cjs +379 -0
  120. package/scripts/verify-job-order.sh +30 -0
  121. package/src/cli/index.ts +414 -0
  122. package/src/generators/init.tpl.ts +126 -0
  123. package/src/generators/workflows.tpl.ts +80 -0
  124. package/src/templates/actions/calculate-version.yml.tpl.ts +124 -0
  125. package/src/templates/actions/create-pr.yml.tpl.ts +147 -0
  126. package/src/templates/actions/create-tag.yml.tpl.ts +112 -0
  127. package/src/templates/actions/detect-changes.yml.tpl.ts +87 -0
  128. package/src/templates/actions/manage-branch.yml.tpl.ts +132 -0
  129. package/src/templates/actions/promote-branch.yml.tpl.ts +364 -0
  130. package/src/templates/workflows/pipeline-path-based.yml.tpl.ts +706 -0
  131. package/src/types/index.ts +64 -0
  132. package/src/utils/README-ast-path-operations.md +390 -0
  133. package/src/utils/ast-path-operations.ts +581 -0
  134. package/src/utils/config.ts +64 -0
  135. package/src/utils/github-setup.ts +558 -0
  136. package/src/utils/idempotency.ts +215 -0
  137. package/src/utils/preflight.ts +306 -0
  138. package/src/utils/versioning.ts +244 -0
  139. package/tests/README.md +229 -0
  140. package/tests/TEST_STRUCTURE.md +256 -0
  141. package/tests/act/run-act-tests.sh +345 -0
  142. package/tests/debugging/debug-utils.ts +538 -0
  143. package/tests/debugging/debug-workflow.test.ts +339 -0
  144. package/tests/debugging/debug-workflows.sh +339 -0
  145. package/tests/debugging/iterative-debug.ts +652 -0
  146. package/tests/debugging/run-debug-tests.sh +431 -0
  147. package/tests/fixtures/basic-config.json +51 -0
  148. package/tests/fixtures/invalid-config.json +9 -0
  149. package/tests/fixtures/pipeline-generated.yml +235 -0
  150. package/tests/fixtures/pipeline-preserve-comments.yml +245 -0
  151. package/tests/fixtures/pipeline-user-modified.yml +245 -0
  152. package/tests/fixtures/test-config.json +58 -0
  153. package/tests/github-live/README.md +250 -0
  154. package/tests/github-local/JOB_WORKFLOW_TESTS.md +296 -0
  155. package/tests/github-local/README.md +240 -0
  156. package/tests/github-local/run-all-tests.sh +422 -0
  157. package/tests/github-local/test-job-workflows.sh +631 -0
  158. package/tests/github-local/test-pipeline-workflow.sh +440 -0
  159. package/tests/integration/generators.test.ts +578 -0
  160. package/tests/integration/path-based-template.test.ts +510 -0
  161. package/tests/integration/simple-path-based.test.ts +415 -0
  162. package/tests/setup.ts +56 -0
  163. package/tests/unit/ast-path-operations-extended.test.ts +302 -0
  164. package/tests/unit/cli.test.ts +541 -0
  165. package/tests/unit/config-extended.test.ts +412 -0
  166. package/tests/unit/config.test.ts +152 -0
  167. package/tests/unit/github-setup.test.ts +189 -0
  168. package/tests/unit/idempotency-isolated.test.ts +297 -0
  169. package/tests/unit/job-order.test.ts +157 -0
  170. package/tests/unit/pipeline-path-based.test.ts +511 -0
  171. package/tests/unit/validate-pipeline.test.ts +384 -0
  172. package/tests/unit/versioning-extended.test.ts +279 -0
  173. package/tests/unit/versioning.test.ts +241 -0
  174. package/tsconfig.debug.json +17 -0
  175. package/tsconfig.json +28 -0
  176. package/vitest.config.ts +51 -0
@@ -0,0 +1,235 @@
1
+ ## USER COMMENT 1
2
+
3
+ name: "USER NAME"
4
+ # USER COMMENT 2
5
+ on:
6
+ pull_request:
7
+ paths:
8
+ - '**/*.yml'
9
+ - '**/*.yaml'
10
+ - '**/*.json'
11
+ - '**/*.ts'
12
+ - '**/*.js'
13
+ - '**/*.tsx'
14
+ # USER COMMENT 3
15
+ branches:
16
+ - develop
17
+ - feature
18
+ - alpha
19
+ - beta
20
+ - gamma
21
+ - delta
22
+ - epsilon
23
+ # USER COMMENT 4
24
+
25
+ workflow_call:
26
+ inputs:
27
+ # USER COMMENT 5
28
+ fakevar1:
29
+ description: 'The fake version to deploy'
30
+ required: false
31
+ type: string
32
+ version:
33
+ description: The version to deploy
34
+ required: false
35
+ type: string
36
+ # USER COMMENT 7
37
+ fakevar2:
38
+ description: 'The fake version to deploy'
39
+ required: false
40
+ type: string
41
+ baseRef:
42
+ description: The base reference for comparison
43
+ required: false
44
+ type: string
45
+ # USER COMMENT 8
46
+ outputs:
47
+ fakevar3:
48
+ value: 'fakevalue3'
49
+ fakevar4:
50
+ value: 'fakevalue4'
51
+ workflow_dispatch:
52
+ inputs:
53
+ version:
54
+ description: The version to deploy
55
+ required: false
56
+ type: string
57
+ baseRef:
58
+ description: The base reference for comparison
59
+ required: false
60
+ type: string
61
+
62
+ jobs:
63
+ # USER COMMENT 9
64
+
65
+ fake-job-1:
66
+ # USER COMMENT 10
67
+ runs-on: ubuntu-latest
68
+ steps:
69
+ - name: Fake Job
70
+ run: |
71
+ echo "Running fake job"
72
+
73
+ # =============================================================================
74
+ # CHANGES DETECTION
75
+ # =============================================================================
76
+ # USER COMMENT 11
77
+ changes:
78
+ runs-on: ubuntu-latest
79
+ steps:
80
+ - uses: ./.github/actions/detect-changes
81
+ with:
82
+ baseRef: ${{ inputs.baseRef || 'epsilon' }}
83
+
84
+ # USER COMMENT 12
85
+ fake-job-2:
86
+ # USER COMMENT 13
87
+ runs-on: ubuntu-latest
88
+ steps:
89
+ - name: Fake Job
90
+ run: |
91
+ echo "Running fake job"
92
+
93
+ # =============================================================================
94
+ # TESTING JOBS
95
+ # =============================================================================
96
+ # Add your testing jobs here
97
+ # Example:
98
+ # test-api:
99
+ # needs: branch
100
+ # runs-on: ubuntu-latest
101
+ # steps:
102
+ # - name: Test API
103
+ # run: |
104
+ # echo "Run API tests"
105
+ #
106
+ # test-web:
107
+ # needs: branch
108
+ # runs-on: ubuntu-latest
109
+ # steps:
110
+ # - name: Test Web
111
+ # run: |
112
+ # echo "Run Web tests"
113
+
114
+
115
+ # USER COMMENT 14
116
+
117
+ fake-job-3:
118
+ # USER COMMENT 15
119
+ runs-on: ubuntu-latest
120
+ steps:
121
+ - name: Fake Job
122
+ run: |
123
+ echo "Running fake job"
124
+
125
+ # =============================================================================
126
+ # VERSIONING
127
+ # =============================================================================
128
+ version:
129
+ if: github.ref_name == 'alpha'
130
+ needs: changes
131
+ runs-on: ubuntu-latest
132
+ steps:
133
+ - uses: ./.github/actions/calculate-version
134
+ with:
135
+ baseRef: ${{ inputs.baseRef || 'epsilon' }}
136
+
137
+ # USER COMMENT 16
138
+
139
+ fake-job-4:
140
+ # USER COMMENT 17
141
+ runs-on: ubuntu-latest
142
+ steps:
143
+ - name: Fake Job
144
+ run: |
145
+ echo "Running fake job"
146
+
147
+ # USER COMMENT 18
148
+
149
+ fake-job-5:
150
+ # USER COMMENT 19
151
+ runs-on: ubuntu-latest
152
+ steps:
153
+ - name: Fake Job
154
+ run: |
155
+ echo "Running fake job"
156
+
157
+ # USER COMMENT 20
158
+
159
+ # =============================================================================
160
+ # DEPLOYMENT JOBS
161
+ # =============================================================================
162
+ deploy-api:
163
+ needs: branch
164
+ runs-on: ubuntu-latest
165
+ steps:
166
+ - name: Deploy API
167
+ run: |
168
+ echo "Deploy API to production"
169
+
170
+ fake-job-6:
171
+ # USER COMMENT 21
172
+ runs-on: ubuntu-latest
173
+ steps:
174
+ - name: Fake Job
175
+ run: |
176
+ echo "Running fake job"
177
+
178
+ # =============================================================================
179
+ # TAG & CREATE PR
180
+ # =============================================================================
181
+ tag:
182
+ if: github.ref_name == 'alpha'
183
+ needs: version
184
+ runs-on: ubuntu-latest
185
+ steps:
186
+ - uses: ./.github/actions/create-tag
187
+ with:
188
+ version: ${{ needs.version.outputs.nextVersion }}
189
+
190
+ # USER COMMENT 22
191
+
192
+ fake-job-7:
193
+ # USER COMMENT 23
194
+ runs-on: ubuntu-latest
195
+ steps:
196
+ - name: Fake Job
197
+ run: |
198
+ echo "Running fake job"
199
+
200
+ createpr:
201
+ ## SHOULD BE ANY BRANCH EXCEPT the final branch
202
+ if: github.ref_name != 'epsilon'
203
+ needs: tag
204
+ runs-on: ubuntu-latest
205
+ steps:
206
+ - uses: ./.github/actions/create-pr
207
+ with:
208
+ sourceBranch: ${{ github.ref_name }}
209
+ targetBranch: ${{ github.ref_name == 'alpha' && 'beta' || github.ref_name ==
210
+ 'beta' && 'gamma' || 'epsilon' }}
211
+ title: 'Release ${{ needs.version.outputs.nextVersion }}'
212
+ body: 'Automated release PR for version ${{ needs.version.outputs.nextVersion
213
+ }}'
214
+
215
+ branch:
216
+ ## SHOULD BE THE NEXT BRANCH
217
+ needs: createpr
218
+ runs-on: ubuntu-latest
219
+ steps:
220
+ - uses: ./.github/actions/manage-branch
221
+ with:
222
+ action: 'fast-forward'
223
+ targetBranch: ${{ github.ref_name == 'alpha' && 'beta' || github.ref_name ==
224
+ 'beta' && 'gamma' || 'epsilon' }}
225
+ sourceBranch: ${{ github.ref_name }}
226
+
227
+ # USER COMMENT 24
228
+
229
+ fake-job-8:
230
+ # USER COMMENT 25
231
+ runs-on: ubuntu-latest
232
+ steps:
233
+ - name: Fake Job
234
+ run: |
235
+ echo "Running fake job"
@@ -0,0 +1,245 @@
1
+ ## USER COMMENT 1
2
+
3
+ name: "USER NAME"
4
+ # USER COMMENT 2
5
+ on:
6
+ pull_request:
7
+ paths:
8
+ - '**/*.yml'
9
+ - '**/*.yaml'
10
+ - '**/*.json'
11
+ - '**/*.ts'
12
+ - '**/*.js'
13
+ - '**/*.tsx'
14
+ # USER COMMENT 3
15
+ branches:
16
+ - develop
17
+ - feature
18
+ - alpha
19
+ - beta
20
+ - gamma
21
+ - delta
22
+ - epsilon
23
+ # USER COMMENT 4
24
+
25
+ workflow_call:
26
+ inputs:
27
+ # USER COMMENT 5
28
+ fakevar1:
29
+ description: 'The fake version to deploy'
30
+ required: false
31
+ type: string
32
+ version:
33
+ description: The version to deploy
34
+ required: false
35
+ type: string
36
+ # USER COMMENT 7
37
+ fakevar2:
38
+ description: 'The fake version to deploy'
39
+ required: false
40
+ type: string
41
+ baseRef:
42
+ description: The base reference for comparison
43
+ required: false
44
+ type: string
45
+ # USER COMMENT 8
46
+ outputs:
47
+ fakevar3:
48
+ value: 'fakevalue3'
49
+ fakevar4:
50
+ value: 'fakevalue4'
51
+ workflow_dispatch:
52
+ inputs:
53
+ version:
54
+ description: The version to deploy
55
+ required: false
56
+ type: string
57
+ baseRef:
58
+ description: The base reference for comparison
59
+ required: false
60
+ type: string
61
+
62
+ jobs:
63
+ # USER COMMENT 9
64
+
65
+ fake-job-1:
66
+ # USER COMMENT 10
67
+ runs-on: ubuntu-latest
68
+ steps:
69
+ - name: Fake Job
70
+ run: |
71
+ echo "Running fake job"
72
+
73
+ # =============================================================================
74
+ # CHANGES DETECTION
75
+ # =============================================================================
76
+ # USER COMMENT 11
77
+ changes:
78
+ runs-on: ubuntu-latest
79
+ steps:
80
+ - uses: ./.github/actions/detect-changes
81
+ with:
82
+ baseRef: ${{ inputs.baseRef || 'epsilon' }}
83
+
84
+ # USER COMMENT 12
85
+ fake-job-2:
86
+ # USER COMMENT 13
87
+ runs-on: ubuntu-latest
88
+ steps:
89
+ - name: Fake Job
90
+ run: |
91
+ echo "Running fake job"
92
+
93
+ # =============================================================================
94
+ # TESTING JOBS
95
+ # =============================================================================
96
+ # Add your testing jobs here
97
+ # Example:
98
+ # test-api:
99
+ # needs: branch
100
+ # runs-on: ubuntu-latest
101
+ # steps:
102
+ # - name: Test API
103
+ # run: |
104
+ # echo "Run API tests"
105
+ #
106
+ # test-web:
107
+ # needs: branch
108
+ # runs-on: ubuntu-latest
109
+ # steps:
110
+ # - name: Test Web
111
+ # run: |
112
+ # echo "Run Web tests"
113
+
114
+
115
+ # USER COMMENT 14
116
+
117
+ fake-job-3:
118
+ # USER COMMENT 15
119
+ runs-on: ubuntu-latest
120
+ steps:
121
+ - name: Fake Job
122
+ run: |
123
+ echo "Running fake job"
124
+
125
+ # =============================================================================
126
+ # VERSIONING
127
+ # =============================================================================
128
+ version:
129
+ # =============================================================================
130
+ # VERSIONING
131
+ # =============================================================================
132
+ if: github.ref_name == 'alpha'
133
+ needs: changes
134
+ runs-on: ubuntu-latest
135
+ steps:
136
+ - uses: ./.github/actions/calculate-version
137
+ with:
138
+ baseRef: ${{ inputs.baseRef || 'epsilon' }}
139
+
140
+ # USER COMMENT 16
141
+
142
+ fake-job-4:
143
+ # USER COMMENT 17
144
+ runs-on: ubuntu-latest
145
+ steps:
146
+ - name: Fake Job
147
+ run: |
148
+ echo "Running fake job"
149
+
150
+ # USER COMMENT 18
151
+
152
+ fake-job-5:
153
+ # USER COMMENT 19
154
+ runs-on: ubuntu-latest
155
+ steps:
156
+ - name: Fake Job
157
+ run: |
158
+ echo "Running fake job"
159
+
160
+ # USER COMMENT 20
161
+
162
+ # =============================================================================
163
+ # DEPLOYMENT JOBS
164
+ # =============================================================================
165
+ deploy-api:
166
+ needs: branch
167
+ runs-on: ubuntu-latest
168
+ steps:
169
+ - name: Deploy API
170
+ run: |
171
+ echo "Deploy API to production"
172
+
173
+ fake-job-6:
174
+ # USER COMMENT 21
175
+ runs-on: ubuntu-latest
176
+ steps:
177
+ - name: Fake Job
178
+ run: |
179
+ echo "Running fake job"
180
+
181
+ # =============================================================================
182
+ # TAG & CREATE PR
183
+ # =============================================================================
184
+ tag:
185
+ # =============================================================================
186
+ # TAG & CREATE PR
187
+ # =============================================================================
188
+ if: github.ref_name == 'alpha'
189
+ needs: version
190
+ runs-on: ubuntu-latest
191
+ steps:
192
+ - uses: ./.github/actions/create-tag
193
+ with:
194
+ version: ${{ needs.version.outputs.nextVersion }}
195
+
196
+ # USER COMMENT 22
197
+
198
+ fake-job-7:
199
+ # USER COMMENT 23
200
+ runs-on: ubuntu-latest
201
+ steps:
202
+ - name: Fake Job
203
+ run: |
204
+ echo "Running fake job"
205
+
206
+ createpr:
207
+ ## SHOULD BE ANY BRANCH EXCEPT the final branch
208
+ if: github.ref_name != 'epsilon'
209
+ needs: tag
210
+ runs-on: ubuntu-latest
211
+ steps:
212
+ - uses: ./.github/actions/create-pr
213
+ with:
214
+ sourceBranch: ${{ github.ref_name }}
215
+ targetBranch: ${{ github.ref_name == 'alpha' && 'beta' || github.ref_name ==
216
+ 'beta' && 'gamma' || github.ref_name == 'gamma' && 'delta' ||
217
+ github.ref_name == 'delta' && 'epsilon' || github.ref_name ==
218
+ 'epsilon' && 'epsilon' || 'epsilon' }}
219
+ title: 'Release ${{ needs.version.outputs.nextVersion }}'
220
+ body: 'Automated release PR for version ${{ needs.version.outputs.nextVersion
221
+ }}'
222
+
223
+ branch:
224
+ ## SHOULD BE THE NEXT BRANCH
225
+ needs: createpr
226
+ runs-on: ubuntu-latest
227
+ steps:
228
+ - uses: ./.github/actions/manage-branch
229
+ with:
230
+ action: 'fast-forward'
231
+ targetBranch: ${{ github.ref_name == 'alpha' && 'beta' || github.ref_name ==
232
+ 'beta' && 'gamma' || github.ref_name == 'gamma' && 'delta' ||
233
+ github.ref_name == 'delta' && 'epsilon' || github.ref_name ==
234
+ 'epsilon' && 'epsilon' || 'epsilon' }}
235
+ sourceBranch: ${{ github.ref_name }}
236
+
237
+ # USER COMMENT 24
238
+
239
+ fake-job-8:
240
+ # USER COMMENT 25
241
+ runs-on: ubuntu-latest
242
+ steps:
243
+ - name: Fake Job
244
+ run: |
245
+ echo "Running fake job"
@@ -0,0 +1,245 @@
1
+ ## USER COMMENT 1
2
+
3
+ name: "USER NAME"
4
+ # USER COMMENT 2
5
+ on:
6
+ pull_request:
7
+ paths:
8
+ - '**/*.yml'
9
+ - '**/*.yaml'
10
+ - '**/*.json'
11
+ - '**/*.ts'
12
+ - '**/*.js'
13
+ - '**/*.tsx'
14
+ # USER COMMENT 3
15
+ branches:
16
+ - develop
17
+ - feature
18
+ - alpha
19
+ - beta
20
+ - gamma
21
+ - delta
22
+ - epsilon
23
+ # USER COMMENT 4
24
+
25
+ workflow_call:
26
+ inputs:
27
+ # USER COMMENT 5
28
+ fakevar1:
29
+ description: 'The fake version to deploy'
30
+ required: false
31
+ type: string
32
+ version:
33
+ description: The version to deploy
34
+ required: false
35
+ type: string
36
+ # USER COMMENT 7
37
+ fakevar2:
38
+ description: 'The fake version to deploy'
39
+ required: false
40
+ type: string
41
+ baseRef:
42
+ description: The base reference for comparison
43
+ required: false
44
+ type: string
45
+ # USER COMMENT 8
46
+ outputs:
47
+ fakevar3:
48
+ value: 'fakevalue3'
49
+ fakevar4:
50
+ value: 'fakevalue4'
51
+ workflow_dispatch:
52
+ inputs:
53
+ version:
54
+ description: The version to deploy
55
+ required: false
56
+ type: string
57
+ baseRef:
58
+ description: The base reference for comparison
59
+ required: false
60
+ type: string
61
+
62
+ jobs:
63
+ # USER COMMENT 9
64
+
65
+ fake-job-1:
66
+ # USER COMMENT 10
67
+ runs-on: ubuntu-latest
68
+ steps:
69
+ - name: Fake Job
70
+ run: |
71
+ echo "Running fake job"
72
+
73
+ # =============================================================================
74
+ # CHANGES DETECTION
75
+ # =============================================================================
76
+ # USER COMMENT 11
77
+ changes:
78
+ runs-on: ubuntu-latest
79
+ steps:
80
+ - uses: ./.github/actions/detect-changes
81
+ with:
82
+ baseRef: ${{ inputs.baseRef || epsilon }}
83
+
84
+ # USER COMMENT 12
85
+ fake-job-2:
86
+ # USER COMMENT 13
87
+ runs-on: ubuntu-latest
88
+ steps:
89
+ - name: Fake Job
90
+ run: |
91
+ echo "Running fake job"
92
+
93
+ # =============================================================================
94
+ # TESTING JOBS
95
+ # =============================================================================
96
+ # Add your testing jobs here
97
+ # Example:
98
+ # test-api:
99
+ # needs: branch
100
+ # runs-on: ubuntu-latest
101
+ # steps:
102
+ # - name: Test API
103
+ # run: |
104
+ # echo "Run API tests"
105
+ #
106
+ # test-web:
107
+ # needs: branch
108
+ # runs-on: ubuntu-latest
109
+ # steps:
110
+ # - name: Test Web
111
+ # run: |
112
+ # echo "Run Web tests"
113
+
114
+
115
+ # USER COMMENT 14
116
+
117
+ fake-job-3:
118
+ # USER COMMENT 15
119
+ runs-on: ubuntu-latest
120
+ steps:
121
+ - name: Fake Job
122
+ run: |
123
+ echo "Running fake job"
124
+
125
+ # =============================================================================
126
+ # VERSIONING
127
+ # =============================================================================
128
+ version:
129
+ # =============================================================================
130
+ # VERSIONING
131
+ # =============================================================================
132
+ if: github.ref_name == 'alpha'
133
+ needs: changes
134
+ runs-on: ubuntu-latest
135
+ steps:
136
+ - uses: ./.github/actions/calculate-version
137
+ with:
138
+ baseRef: ${{ inputs.baseRef || 'epsilon' }}
139
+
140
+ # USER COMMENT 16
141
+
142
+ fake-job-4:
143
+ # USER COMMENT 17
144
+ runs-on: ubuntu-latest
145
+ steps:
146
+ - name: Fake Job
147
+ run: |
148
+ echo "Running fake job"
149
+
150
+ # USER COMMENT 18
151
+
152
+ fake-job-5:
153
+ # USER COMMENT 19
154
+ runs-on: ubuntu-latest
155
+ steps:
156
+ - name: Fake Job
157
+ run: |
158
+ echo "Running fake job"
159
+
160
+ # USER COMMENT 20
161
+
162
+ # =============================================================================
163
+ # DEPLOYMENT JOBS
164
+ # =============================================================================
165
+ deploy-api:
166
+ needs: branch
167
+ runs-on: ubuntu-latest
168
+ steps:
169
+ - name: Deploy API
170
+ run: |
171
+ echo "Deploy API to production"
172
+
173
+ fake-job-6:
174
+ # USER COMMENT 21
175
+ runs-on: ubuntu-latest
176
+ steps:
177
+ - name: Fake Job
178
+ run: |
179
+ echo "Running fake job"
180
+
181
+ # =============================================================================
182
+ # TAG & CREATE PR
183
+ # =============================================================================
184
+ tag:
185
+ # =============================================================================
186
+ # TAG & CREATE PR
187
+ # =============================================================================
188
+ if: github.ref_name == 'alpha'
189
+ needs: version
190
+ runs-on: ubuntu-latest
191
+ steps:
192
+ - uses: ./.github/actions/create-tag
193
+ with:
194
+ version: ${{ needs.version.outputs.nextVersion }}
195
+
196
+ # USER COMMENT 22
197
+
198
+ fake-job-7:
199
+ # USER COMMENT 23
200
+ runs-on: ubuntu-latest
201
+ steps:
202
+ - name: Fake Job
203
+ run: |
204
+ echo "Running fake job"
205
+
206
+ createpr:
207
+ ## SHOULD BE ANY BRANCH EXCEPT the final branch
208
+ if: github.ref_name != 'epsilon'
209
+ needs: tag
210
+ runs-on: ubuntu-latest
211
+ steps:
212
+ - uses: ./.github/actions/create-pr
213
+ with:
214
+ sourceBranch: ${{ github.ref_name }}
215
+ targetBranch: ${{ github.ref_name == 'alpha' && 'beta' || github.ref_name ==
216
+ 'beta' && 'gamma' || github.ref_name == 'gamma' && 'delta' ||
217
+ github.ref_name == 'delta' && 'epsilon' || github.ref_name ==
218
+ 'epsilon' && 'epsilon' || 'epsilon' }}
219
+ title: 'Release ${{ needs.version.outputs.nextVersion }}'
220
+ body: 'Automated release PR for version ${{ needs.version.outputs.nextVersion
221
+ }}'
222
+
223
+ branch:
224
+ ## SHOULD BE THE NEXT BRANCH
225
+ needs: createpr
226
+ runs-on: ubuntu-latest
227
+ steps:
228
+ - uses: ./.github/actions/manage-branch
229
+ with:
230
+ action: 'fast-forward'
231
+ targetBranch: ${{ github.ref_name == 'alpha' && 'beta' || github.ref_name ==
232
+ 'beta' && 'gamma' || github.ref_name == 'gamma' && 'delta' ||
233
+ github.ref_name == 'delta' && 'epsilon' || github.ref_name ==
234
+ 'epsilon' && 'epsilon' || 'epsilon' }}
235
+ sourceBranch: ${{ github.ref_name }}
236
+
237
+ # USER COMMENT 24
238
+
239
+ fake-job-8:
240
+ # USER COMMENT 25
241
+ runs-on: ubuntu-latest
242
+ steps:
243
+ - name: Fake Job
244
+ run: |
245
+ echo "Running fake job"