Skip to content

Commit

Permalink
fix: don't warn about vcs token if ignore_token_for_push is true. (#670)
Browse files Browse the repository at this point in the history
* fix: don't warn about vcs token if ignore_token_for_push is true.

* docs: `password` should be `token`.
  • Loading branch information
lukester1975 committed Aug 10, 2023
1 parent 879186a commit f1a54a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ configuration file (**Note: this is not advisable**):
Unfortunately, this configuration lives in your Git repository along with your source
code, and this would represent insecure management of your password. It is recommended
to use an environment variable to provide the required password. Suppose you would
like to specify that should be read from the environment variable ``GH_TOKEN``.
like to specify that should be read from the environment variable ``GH_TOKEN``.
In this case, you should modify your configuration to the following:
.. code-block:: toml
[tool.semantic_release.remote]
password = { env = "GH_TOKEN" }
token = { env = "GH_TOKEN" }
This is equivalent to the default:
Expand Down
2 changes: 1 addition & 1 deletion semantic_release/cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def from_raw_config(
)

token = cls.resolve_from_env(raw.remote.token)
if isinstance(raw.remote.token, EnvConfigVar) and not token:
if isinstance(raw.remote.token, EnvConfigVar) and not raw.remote.ignore_token_for_push and not token:
log.warning(
"the token for the remote VCS is configured as stored in the %s environment variable, but it is empty",
raw.remote.token.env,
Expand Down

0 comments on commit f1a54a6

Please sign in to comment.