Skip to content

Support for reading auth env vars from .env file#195

Open
elacuesta wants to merge 1 commit into
masterfrom
dotenv-support
Open

Support for reading auth env vars from .env file#195
elacuesta wants to merge 1 commit into
masterfrom
dotenv-support

Conversation

@elacuesta

Copy link
Copy Markdown
Member

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.80%. Comparing base (d06fdb8) to head (ae6dab3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #195      +/-   ##
==========================================
- Coverage   93.82%   93.80%   -0.02%     
==========================================
  Files          28       28              
  Lines        1958     1968      +10     
==========================================
+ Hits         1837     1846       +9     
- Misses        121      122       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread docs/quickstart.rst
Comment on lines +41 to +44
Instead of exporting the variable yourself, you can store it in a ``.env``
file and let the client load it::

SH_APIKEY=84c87545607a4bc0****************

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same 💄 suggestion as in the other PR 🙂

Comment on lines +142 to +148
# Fall back to the .env file only when the environment has no usable
# credentials, so an exported key never triggers a file lookup.
if not apikey and not jobauth:
dotenv = _read_dotenv_auth(dotenv_path)
apikey = next((dotenv[var] for var in _APIKEY_VARS
if dotenv.get(var)), None)
jobauth = dotenv.get('SHUB_JOBAUTH')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if SH_APIKEY is set as an env var but SHUB_JOBAUTH is not, a .env SH_APIKEY takes over the env var?

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