From cee281f190702dc75db5c748e0f0217089194b25 Mon Sep 17 00:00:00 2001 From: liheavy Date: Wed, 29 Jun 2022 11:29:15 +0800 Subject: [PATCH] update gitlab token name --- cve-agency-manager/cve_tracking/util/gitlab_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cve-agency-manager/cve_tracking/util/gitlab_api.py b/cve-agency-manager/cve_tracking/util/gitlab_api.py index a127e8a..5fcc2d5 100644 --- a/cve-agency-manager/cve_tracking/util/gitlab_api.py +++ b/cve-agency-manager/cve_tracking/util/gitlab_api.py @@ -21,15 +21,15 @@ class Gitlab(Api): host = "https://gitlab.com/api/v4/projects" def __init__(self) -> None: - if not settings.token(name="gitlab") and not os.getenv("GITLAB-TOKEN", None): + if not settings.token(name="gitlab") and not os.getenv("GITLAB_TOKEN", None): raise ConfigNotFoundError( - "Please set the 'GITLAB-TOKEN' environment variable for gitlab." + "Please set the 'GITLAB_TOKEN' environment variable for gitlab." ) super(Gitlab, self).__init__() @property def _headers(self): - return {"PRIVATE-TOKEN": os.getenv("GITLAB-TOKEN", settings.token('gitlab'))} + return {"PRIVATE-TOKEN": os.getenv("GITLAB_TOKEN", settings.token('gitlab'))} async def get_commit_comments(self, commit_sha): """ -- Gitee