logs.gokuls.in

2 pull requests merged across 1 repo

bahdotsh/wrkflw

  • toJSON(env) was returning "null" because ExprValue had no Object variant — bare env fell through all resolve() match arms to Null
  • Adds Object(HashMap<String, ExprValue>) variant to ExprValue, with proper handling in is_truthy, to_output_string, toJSON, and comparison helpers
  • Bare env now resolves to an Object containing user-set env vars (excludes system-injected GITHUB_*, RUNNER_*, INPUT_*, WRKFLW_*, CI keys)
  • toJSON(env) produces sorted, pretty-printed JSON matching real GitHub Actions behavior

Test plan

  • tojson_env_returns_object — verifies JSON output contains only user env vars, excludes system vars
  • tojson_env_sorted_keys — verifies keys are alphabetically sorted
  • bare_env_is_truthy — verifies env object is truthy
  • bare_env_to_output_string — verifies ${{ env }} renders as [object Object]
  • All 55 expression tests pass
  • WorkflowDefinition was missing an env field — serde silently discarded workflow-level env: during YAML deserialization
  • ${{ env.GLOBAL_VAR }} evaluated to empty string while $GLOBAL_VAR in shell worked fine, because the OS environment got the vars but the expression evaluator never did
  • Added the env field to WorkflowDefinition and merged it into env_context right after create_github_context(), giving correct precedence: step > job > workflow (matching GitHub Actions)

Test plan

  • All existing tests pass (cargo test)
  • Verified end-to-end: ${{ env.ANOTHER_VAR }} resolves workflow-level env correctly
  • Verified precedence: job-level env overrides workflow-level when both define the same key
  • CI passes