我想列出GitLab项目中的所有项目变量.我已经关注了他们的官方documentation,但似乎我无法让它工作.
以下是我的代码:
import gitlab, os
# authenticate
gl = gitlab.Gitlab('https://gitlab.com/', private_token=os.environ['GITLAB_TOKEN'])
group = gl.groups.get(20, lazy=True)
projects = group.projects.list(include_subgroups=True, all=True)
for project in projects:
project.variables.list()
错误:
Attribute错误: 'GroupProject' object has no attribute 'variables'