Repository navigation
feat: add format-command input for a user formatting hook - #120
Merged
Merged
Conversation
Specifies the format-command contract: skip on empty command or empty
file list, substitute every {files} placeholder with shell-quoted
paths, run placeholder-free commands as-is, and wrap execution errors
with format-command context.
Refs: #17
Runs a consumer-supplied shell command after synced markdown files are
written and before outputs are set, so the downstream commit step picks
up formatted files. Every {files} placeholder is replaced with the
shell-quoted modified paths; commands without a placeholder run as-is.
Skipped when the input is empty or no files changed; failures fail the
action with format-command context.
Refs: #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the
format-commanddesign approved for #17 (chosen over a hook-script convention, arun-pre-commitboolean, and docs-only).format-commandinput: a shell command the action runs on the synced files after they are written and before outputs are set, so the downstream commit step picks up formatted files.{files}placeholder is replaced with the shell-quoted modified paths (single-quote escaping covers spaces/metacharacters); a command without a placeholder runs as-is.format-command failed: …context.TDD: failing spec committed first (6 new unit tests — placeholder substitution, quoting, skip conditions, error wrapping), then the implementation, then docs (
action.yml, README inputs table, changelog) + rebuiltdist/. 121/121 tests, full hook suite green.Refs: #17