Skip to content

feat: add {{os}} template func + vault $VAR parity#184

Merged
xaaha merged 2 commits intomainfrom
simplify-var-lookup
Apr 29, 2026
Merged

feat: add {{os}} template func + vault $VAR parity#184
xaaha merged 2 commits intomainfrom
simplify-var-lookup

Conversation

@xaaha
Copy link
Copy Markdown
Owner

@xaaha xaaha commented Apr 29, 2026

Summary

  • Add {{os "VAR"}} template function for direct OS env var access in YAML request files
  • Fix $VAR resolution parity: vault store values now resolve $VAR from OS env, matching .env file behavior

Why

  • Users can reference shell env vars (GITHUB_TOKEN, CI_BUILD_ID) without defining intermediaries in the store
  • {{os "VAR"}} is lazy — only resolves what's referenced, no sensitive vars leaked
  • Vault $VAR gap meant KEY=$OS_VAR worked in .env but not in encrypted store

Test plan

  • {{os "VAR"}} resolves set OS env vars
  • Unset vars return empty string (matches shell behavior)
  • Case sensitive lookup
  • Mix {{.KEY}} and {{os "KEY"}} in same template
  • Multiple {{os}} calls in one string
  • Vault $VAR resolves from OS
  • Non-string vault values unchanged
  • go test ./... -count=1 — all pass, zero regressions

@xaaha xaaha requested a review from pthapa1 April 29, 2026 22:10
@xaaha xaaha merged commit 3bb375b into main Apr 29, 2026
2 checks passed
@xaaha xaaha deleted the simplify-var-lookup branch April 29, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants