Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created March 28, 2021 03:18
Show Gist options
  • Select an option

  • Save KyMidd/c572093405345a695478635216a1f4fb to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/c572093405345a695478635216a1f4fb to your computer and use it in GitHub Desktop.
# If approval required, exit immediately and export values
if [[ $approvalRequired == "yes" ]]; then
echo "****************************************"
echo "##[section]Approval will be required"
echo "****************************************"
echo ""
echo "##vso[task.setvariable variable=approvalRequired;isOutput=true]true"
echo ""
echo ""
break
# If approval not required, continue
elif [[ $approvalRequired == "no" ]]; then
# Can't declare all good here until all lines evaluated, so removed from while loop
# After loop, will gather info and make positive approval choice
continue
# If we haven't made a choice here yet, something has gone wrong, exit
elif [[ $approvalRequired == "notSure" ]]; then
echo "##[error]Something has gone wrong, can't determine"
echo "##[error]Exiting, approval will be required to apply"
exit 1
# Shouldn't reach here
else
echo "##[error]Something has gone wrong, can't determine"
echo "##[error]Exiting, approval will be required to apply"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment