You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo "##vso[task.logissue type=error]RESOURCE_GROUP was not resolved. Verify apim-common defines APIM_RESOURCE_GROUP and is authorized for this pipeline."
69
+
if [[ -z "$APIM_RESOURCE_GROUP" || "$APIM_RESOURCE_GROUP" == '$('*')' ]]; then
70
+
echo "##vso[task.logissue type=error]APIM_RESOURCE_GROUP is not set. Ensure variable group 'apim-\${{ parameters.ENVIRONMENT }}' is authorized and defines APIM_RESOURCE_GROUP."
79
71
exit 2
80
72
fi
81
73
82
-
if is_unresolved "$SERVICE_NAME"; then
83
-
echo "##vso[task.logissue type=error]SERVICE_NAME was not resolved. Verify apim-common defines APIM_SERVICE_NAME and is authorized for this pipeline."
74
+
if [[ -z "$APIM_SERVICE_NAME" || "$APIM_SERVICE_NAME" == '$('*')' ]]; then
75
+
echo "##vso[task.logissue type=error]APIM_SERVICE_NAME is not set. Ensure variable group 'apim-\${{ parameters.ENVIRONMENT }}' is authorized and defines APIM_SERVICE_NAME."
84
76
exit 2
85
77
fi
86
78
87
-
if is_unresolved "$SERVICE_CONNECTION"; then
88
-
echo "##vso[task.logissue type=error]AZURE_SERVICE_CONNECTION was not resolved. Verify apim-common defines AZURE_SERVICE_CONNECTION and is authorized for this pipeline."
79
+
if [[ -z "$SERVICE_CONNECTION" || "$SERVICE_CONNECTION" == '$('*')' ]]; then
80
+
echo "##vso[task.logissue type=error]AZURE_SERVICE_CONNECTION is not set. Ensure variable group 'apim-\${{ parameters.ENVIRONMENT }}' is authorized and defines AZURE_SERVICE_CONNECTION."
89
81
exit 2
90
82
fi
91
83
92
-
if is_unresolved "$SUBSCRIPTION_ID"; then
93
-
echo "##vso[task.logissue type=error]AZURE_SUBSCRIPTION_ID was not resolved. Verify apim-common defines AZURE_SUBSCRIPTION_ID and is authorized for this pipeline."
84
+
if [[ -z "$SUBSCRIPTION_ID" || "$SUBSCRIPTION_ID" == '$('*')' ]]; then
85
+
echo "##vso[task.logissue type=error]AZURE_SUBSCRIPTION_ID is not set. Ensure variable group 'apim-\${{ parameters.ENVIRONMENT }}' is authorized and defines AZURE_SUBSCRIPTION_ID."
94
86
exit 2
95
87
fi
88
+
89
+
echo "All required variables are configured for environment '\${{ parameters.ENVIRONMENT }}'"
96
90
displayName: 'Validate required variables'
97
91
98
92
- task: AzureCLI@2
@@ -103,25 +97,11 @@ steps:
103
97
scriptType: 'bash'
104
98
scriptLocation: 'inlineScript'
105
99
inlineScript: |
106
-
SUBSCRIPTION_ID='$(AZURE_SUBSCRIPTION_ID)'
107
-
108
-
is_unresolved() {
109
-
local value="$1"
110
-
case "$value" in
111
-
""|\$\(*\)) return 0 ;;
112
-
*) return 1 ;;
113
-
esac
114
-
}
115
-
116
-
if is_unresolved "$SUBSCRIPTION_ID"; then
117
-
echo "##vso[task.logissue type=error]AZURE_SUBSCRIPTION_ID was not resolved. Ensure apim-common is authorized and defines AZURE_SUBSCRIPTION_ID."
git commit -m "chore: update APIM artifacts from extract"
171
-
git push origin "$BRANCH_NAME"
172
-
echo "##vso[task.logissue type=warning]Branch '$BRANCH_NAME' pushed. Please create a pull request to merge the changes."
156
+
echo "##vso[task.logissue type=warning]Could not auto-create PR (HTTP $HTTP_STATUS). Please create a PR from '$BRANCH_NAME' to '$TARGET_BRANCH' manually."
173
157
fi
174
-
displayName: 'Create branch with changes'
158
+
displayName: 'Create branch and open pull request'
0 commit comments