Commit 83ea2b3
ci: skip template-incompatible jobs when run on un-initialized template
CI.yaml's unit-tests job runs ./build.ps1 -Task Build,Test, which fails
on the template because Build's GENERATEMARKDOWN task imports
{{ModuleName}}/{{ModuleName}}.psd1 and {{GUID}} can't be parsed as a
valid Guid. PublishModuleToPowerShellGallery.yaml would, if it ever
fired against main with placeholder content, try to publish a literal
"{{ModuleName}}" module to PSGallery.
Add a job-level guard to both:
if: hashFiles('CHANGELOG.template.md') == ''
CHANGELOG.template.md exists only pre-init (Initialize-Template.ps1
moves it onto CHANGELOG.md during init), so the marker flips on the
template / off downstream. The path contains no {{Placeholder}} token,
so init's substitution loop leaves the if-clause untouched in the
copied workflow files — downstream repos run all jobs normally.
The lint job in CI.yaml is left unchanged: Invoke-ScriptAnalyzer runs
fine on the template's placeholder folder. ggshield.yaml and
auto-merge-bots.yml are universal and need no guard.
Companion to PR #15 (template-level CHANGELOG.md / CalVer); reuses the
same marker the Manifest.tests.ps1 -Skip:$isTemplate logic uses there.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 90ecacb commit 83ea2b3
2 files changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
0 commit comments