[PR #5948] docs(man): redact IP-like defaults for address flags in generated man page - Fixes #5894 #2635

Open
opened 2026-03-01 22:37:31 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/5948
Author: @AbhinavSivanandhan
Created: 10/10/2025
Status: 🔄 Open

Base: masterHead: fix/sanitize-manpage-defaults


📝 Commits (1)

  • 2a41b55 docs(man): redact IP-like defaults for address flags in generated man page

📊 Changes

2 files changed (+54 additions, -0 deletions)

View changed files

📝 cmd/root.go (+37 -0)
📝 cmd/root_test.go (+17 -0)

📄 Description

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 rewrites DefValue for matching flags.
  • Unit test TestSanitizeFlagDefaultsForDocs validates behavior across persistent/local flags and subcommands.

Testing

  • go test ./cmd -run Sanitize -v passes
  • Manual: ./act --man-page shows [auto-detected IP] in place of a real IP for address flags.

Fixes #5894


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/5948 **Author:** [@AbhinavSivanandhan](https://github.com/AbhinavSivanandhan) **Created:** 10/10/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/sanitize-manpage-defaults` --- ### 📝 Commits (1) - [`2a41b55`](https://github.com/nektos/act/commit/2a41b55443519fa3c758a47705eb35282871d63a) docs(man): redact IP-like defaults for address flags in generated man page ### 📊 Changes **2 files changed** (+54 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `cmd/root.go` (+37 -0) 📝 `cmd/root_test.go` (+17 -0) </details> ### 📄 Description 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 rewrites `DefValue` for matching flags. - Unit test `TestSanitizeFlagDefaultsForDocs` validates behavior across persistent/local flags and subcommands. Testing - `go test ./cmd -run Sanitize -v` passes - Manual: `./act --man-page` shows `[auto-detected IP]` in place of a real IP for address flags. Fixes #5894 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
starred/act#2635
No description provided.