From f1a54a6c9a05b225b6474d50cd610eca19ec0c34 Mon Sep 17 00:00:00 2001 From: lukester1975 Date: Thu, 10 Aug 2023 19:44:17 +0100 Subject: [PATCH] fix: don't warn about vcs token if ignore_token_for_push is true. (#670) * fix: don't warn about vcs token if ignore_token_for_push is true. * docs: `password` should be `token`. --- docs/configuration.rst | 4 ++-- semantic_release/cli/config.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 05f86144b..e27fa80f2 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -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: diff --git a/semantic_release/cli/config.py b/semantic_release/cli/config.py index dd881bc9b..63cee6c1f 100644 --- a/semantic_release/cli/config.py +++ b/semantic_release/cli/config.py @@ -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,