diff --git a/get-token.py b/get-token.py index ad8d2b3..dbfc951 100755 --- a/get-token.py +++ b/get-token.py @@ -1,4 +1,19 @@ #!/usr/bin/env python3 +""" +Get an Azure DevOps token and print it in a format suitable for exporting as an environment variable. + +Usage: + eval $(python get-token.py) + + or + + python get-token.py > set-ado-token.sh + source set-ado-token.sh + + Now you can use the ADO_TOKEN environment variable, for example using curl: + + curl -H "Authorization: Bearer $ADO_TOKEN" https://dev.azure.com/your_organization/_apis/projects?api-version=7.1 +""" from sk.azure import get_token