feat: add inject-content action #19

Merged
Michael.Seele merged 1 commit from feature/inject-content into main 2026-05-05 12:56:10 +00:00
No description provided.
Michael.Seele added 1 commit 2026-05-05 06:11:36 +00:00
feat: add inject-content action
All checks were successful
validate-shared-actions / validate-shared-actions (pull_request) Successful in 52s
Aikido Security PR Check / Aikido Security Scan (pull_request) Successful in 1m2s
f9d472d3d8
requested review from Developers 2026-05-05 06:11:36 +00:00

Requested changes

  1. Validate mode explicitly (correctness)

    • Current logic treats any value other than "overwrite" as append.
    • This can mask typos ("apend") and produce unexpected file changes.
    • Recommend failing fast for invalid values (append|overwrite only).
  2. Append behavior adds a leading blank line even for new/empty files (correctness)

    • printf '\n%s\n' always prepends a newline.
    • If the target file is empty or newly created, this creates an unnecessary first blank line.
    • Recommend adding the separator newline only when the target file exists and is non-empty.

Nice-to-have

  • Document that writes always add a trailing newline (printf '%s\n'), since this may matter for some formats.
  • Optionally ensure parent directory exists (or fail with a clearer message) for maintainability/debuggability.
### Requested changes 1. **Validate `mode` explicitly (correctness)** - Current logic treats any value other than `"overwrite"` as append. - This can mask typos (`"apend"`) and produce unexpected file changes. - Recommend failing fast for invalid values (`append|overwrite` only). 2. **Append behavior adds a leading blank line even for new/empty files (correctness)** - `printf '\n%s\n'` always prepends a newline. - If the target file is empty or newly created, this creates an unnecessary first blank line. - Recommend adding the separator newline only when the target file exists and is non-empty. ### Nice-to-have - Document that writes always add a trailing newline (`printf '%s\n'`), since this may matter for some formats. - Optionally ensure parent directory exists (or fail with a clearer message) for maintainability/debuggability.
Markus.Opahle requested changes 2026-05-05 12:06:46 +00:00
Dismissed
Markus.Opahle left a comment
Owner

Please address the comments before merging.

Please address the comments before merging.
Michael.Seele force-pushed feature/inject-content from f9d472d3d8 to 9ab5db7b61 2026-05-05 12:23:23 +00:00 Compare
Author
Owner

@Markus.Opahle Updated

@Markus.Opahle Updated
requested review from Markus.Opahle 2026-05-05 12:40:06 +00:00
Markus.Opahle approved these changes 2026-05-05 12:50:05 +00:00
Michael.Seele merged commit dd41de5246 into main 2026-05-05 12:56:10 +00:00
Michael.Seele deleted branch feature/inject-content 2026-05-05 12:56:10 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: schmalz/shared-actions#19
No description provided.