feat(wfctl): discover manifest-driven secrets#867
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends wfctl secrets setup with a manifest-driven mode that can discover required secrets from wfctl.yaml / .wfctl-lock.yaml, installed plugin required_secrets[], and ${ENV_VAR} references found in workflow config YAMLs, then guides GitHub Actions secret setup at repo/env/org scopes using the existing setup engine.
Changes:
- Add
--manifestflow towfctl secrets setup, including discovery from manifest + lockfile + config env references. - Enhance plugin manifest loading to match real install layouts (full name, normalized provider name, or
workflow-plugin-<provider>). - Update docs to describe manifest-driven secret setup and improved scope guidance.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/WFCTL.md | Documents secrets setup --manifest and related flags/examples. |
| docs/wfctl-secrets-scopes.md | Clarifies plugin manifest lookup behavior and adds repo-level manifest-driven setup example. |
| docs/iac-dns-providers.md | Adds manifest-driven secrets setup guidance for provider plugins. |
| cmd/wfctl/secrets_setup.go | Routes secrets setup to manifest-driven implementation when --manifest is present. |
| cmd/wfctl/secrets_setup_plugin.go | Updates plugin manifest resolution to try multiple candidate install directories. |
| cmd/wfctl/secrets_setup_plugin_test.go | Adds coverage for loading plugin manifests from normalized install directories. |
| cmd/wfctl/secrets_setup_manifest.go | Implements manifest-driven secret discovery + setup engine integration. |
| cmd/wfctl/secrets_setup_manifest_test.go | Adds tests for discovery and manifest flag parsing. |
| if in != nil { | ||
| for _, kv := range readKVLines(in) { | ||
| k, v, ok := strings.Cut(kv, "=") | ||
| if ok { | ||
| secretMap[k] = v | ||
| } | ||
| } | ||
| } | ||
| interactive := in == nil && isatty.IsTerminal(os.Stdin.Fd()) |
| if err := fs.Parse(args); err != nil { | ||
| return nil, err | ||
| } | ||
| _ = nonInteractive |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
Summary
wfctl secrets setup --manifest wfctl.yamlto discover secrets fromwfctl.yaml,.wfctl-lock.yaml, installed pluginrequired_secrets[], and${ENV_VAR}references in config YAML.--from-env,--secret, interactive prompts,--only, and--skip-existingbehavior.workflow-plugin-<provider>.Verification
GOWORK=off go test ./cmd/wfctl -run 'TestDiscoverManifestSecrets|TestParseManifestSetupFlags|TestLoadPluginManifest' -count=1GOWORK=off go test ./cmd/wfctl -count=1git diff --check HEAD~1..HEADFixes #864