gitlab_*_variable: add description option (#10812)

This commit is contained in:
David Phillips 2025-09-19 07:55:28 +12:00 committed by GitHub
commit 7a231a248e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 52 additions and 25 deletions

View file

@ -134,7 +134,7 @@ def gitlab_authentication(module, min_version=None):
def filter_returned_variables(gitlab_variables):
# pop properties we don't know
existing_variables = [dict(x.attributes) for x in gitlab_variables]
KNOWN = ['key', 'value', 'masked', 'hidden', 'protected', 'variable_type', 'environment_scope', 'raw']
KNOWN = ['key', 'value', 'description', 'masked', 'hidden', 'protected', 'variable_type', 'environment_scope', 'raw']
for item in existing_variables:
for key in list(item.keys()):
if key not in KNOWN:
@ -151,6 +151,7 @@ def vars_to_variables(vars, module):
{
"name": item,
"value": str(value),
"description": None,
"masked": False,
"protected": False,
"hidden": False,
@ -163,6 +164,7 @@ def vars_to_variables(vars, module):
new_item = {
"name": item,
"value": value.get('value'),
"description": value.get('description'),
"masked": value.get('masked'),
"hidden": value.get('hidden'),
"protected": value.get('protected'),