act
act copied to clipboard
docs(man): redact IP-like defaults for address flags in generated man page - Fixes #5894
Problem:
act --man-page embeds the local outbound IP in defaults for address flags (e.g., --artifact-server-addr, --cache-server-addr). That breaks reproducible builds and leaks a private detail.
Approach: Only for documentation generation, replace printed defaults that:
- are for address-like flags (*-addr, *-address), and
- look like an IPv4 (optionally with :port) with a deterministic placeholder: [auto-detected IP].
Runtime behavior is unchanged. When act actually runs, it still uses the dynamic outbound IP.
Implementation:
- Added a small sanitizer called from
generateManPage()that walks the root command (and subcommands) and rewritesDefValuefor matching flags. - Unit test
TestSanitizeFlagDefaultsForDocsvalidates behavior across persistent/local flags and subcommands.
Testing
go test ./cmd -run Sanitize -vpasses- Manual:
./act --man-pageshows[auto-detected IP]in place of a real IP for address flags.
Fixes #5894