Created
March 3, 2023 19:00
-
-
Save marcosborges/3499ecfc37e9a2b213fa25ff0dc74cd2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Definir variáveis de ambiente | |
ORGANIZATION="minhaorganizacao" | |
PROJECT="meuprojeto" | |
VAR_GROUP_NAME="nome_do_variable_group" | |
VAR_NAME="nome_da_variavel" | |
# Fazer a requisição para a API de Variable Groups do Azure DevOps e filtrar a resposta para encontrar o Variable Group e a variável com o nome especificado | |
response=$(curl -s -u ":$(pat)" \ | |
"https://dev.azure.com/${ORGANIZATION}/${PROJECT}/_apis/distributedtask/variablegroups?groupName=${VAR_GROUP_NAME}&api-version=6.0-preview.2" \ | |
| jq -r ".value[0].variables[] | select(.name == \"${VAR_NAME}\")") | |
# Exibir o resultado | |
echo "${response}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment