Commit 6b5a38b
changelog(prepare-artifact): treat empty existing-filename as unset (#3314)
CLI parsers (Argh, since #3202) forward `--existing-changelog-filename ""`
as the empty string instead of null, so the existing `!= null` guard let
empty filenames through. `Path.GetFileName("")` returns `""`, then
`Path.Combine(OutputDir, "")` collapses to `OutputDir` itself, and the
artifact YAML write target becomes the directory path.
On Linux this fails with EACCES:
Unhandled ChangelogPrepareArtifactService exception:
Access to the path '.../.artifacts/changelog-artifact' is denied.
System.IO.IOException: Permission denied
at System.IO.File.OpenHandle(...)
at System.IO.File.<WriteToFileAsync>...
Switch the guard to `!string.IsNullOrEmpty` and add a regression test.
A complementary fix in elastic/docs-actions stops forwarding the flag
when the value is empty.
Repro: elastic/cloud PR #154858 / run 25721575364
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 549596d commit 6b5a38b
2 files changed
Lines changed: 29 additions & 3 deletions
File tree
- src/services/Elastic.Changelog/Evaluation
- tests/Elastic.Changelog.Tests/Evaluation
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | | - | |
| 60 | + | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
235 | 255 | | |
236 | 256 | | |
237 | 257 | | |
| |||
0 commit comments