CircleCI-Public / circleci-config-sdk-ts

Generate CircleCI Configuration YAML from JavaScript or TypeScript. Use Dynamic Configuration and the Config SDK together for live generative config.
https://circleci-public.github.io/circleci-config-sdk-ts/
Apache License 2.0
82 stars 29 forks source link

feat: add addEnvVar to components #132

Closed KyleTryon closed 2 years ago

KyleTryon commented 2 years ago

Added the ability to add environment variables to the Job, Run Command, and Executor components. Implements a method called addEnvVar() for the three components.

Example

myJob.addEnvVar('MY_VAR', 'my value');

Closes:

ghost commented 2 years ago
👇 Click on the image for a new way to code review - Make big changes easier — review code in small groups of related files - Know where to start — see the whole change at a glance - Take a code tour — explore the change with an interactive tour - Make comments and review — all fully sync’ed with github [Try it now!](https://app.codesee.io/r/reviews?pr=132&src=https%3A%2F%2Fgithub.com%2FCircleCI-Public%2Fcircleci-config-sdk-ts)

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map Legend

codecov[bot] commented 2 years ago

Codecov Report

Merging #132 (2e22cf8) into main (477755b) will decrease coverage by 0.61%. The diff coverage is 75.00%.

@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
- Coverage   99.36%   98.75%   -0.62%     
==========================================
  Files          61       61              
  Lines         627      640      +13     
  Branches       49       54       +5     
==========================================
+ Hits          623      632       +9     
- Misses          3        5       +2     
- Partials        1        3       +2     
Impacted Files Coverage Δ
src/lib/Components/Parameters/types/index.ts 100.00% <ø> (ø)
src/lib/Components/Commands/exports/Native/Run.ts 85.71% <50.00%> (-14.29%) :arrow_down:
src/lib/Components/Executors/exports/Executor.ts 81.81% <60.00%> (-18.19%) :arrow_down:
src/lib/Components/Job/index.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.