Skip to content

Commit f5ca154

Browse files
author
Sheyla Trudo
committed
fixup! Move to Resource Module
1 parent 7afca62 commit f5ca154

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.pipelines/templates/get-resources.steps.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,24 @@ steps:
5959
set -e
6060
[[ -n $SYSTEM_DEBUG ]] && [[ $SYSTEM_DEBUG =~ $IS_TRUE ]] && set -x || set +x
6161
62-
DEFS=$(az role definition list \
62+
DEF_LIST=$(az role definition list \
6363
--name "$ROLEDEFINITION_NAME" \
6464
--custom-role-only \
6565
-ojson | jq -rc '.')
66-
DEFS_FOUND=$(echo "$DEFS" | jq length)
66+
DEF=$(echo "$DEF_LIST" | jq -rc .[0])
67+
DEFS_FOUND=$(echo "$DEF_LIST" | jq length)
6768

68-
if [[ -z $DEFS ]] || \
69+
if [[ -z $DEF_LIST ]] || \
6970
[[ $DEFS_FOUND == 'null' ]] || \
7071
(( $DEFS_FOUND < 1 )); then
7172

72-
DEFS=$(cat "$ROLEDEFINITION_FILEPATH" | \
73+
DEF=$(cat "$ROLEDEFINITION_FILEPATH" | \
7374
jq -rc \
7475
--arg RESOURCEID "/subscriptions/$SUBSCRIPTION_ID" \
7576
'.assignableScopes[] = $RESOURCEID')
7677
fi
7778

78-
echo >&2 "##vso[task.setvariable variable=${VAR_NAME};]$DEFS"
79+
echo >&2 "##vso[task.setvariable variable=${VAR_NAME};]$DEF"
7980
echo >&2 "##vso[task.setvariable variable=${VAR_NAME}_LENGTH;]$DEFS_FOUND"
8081

8182

0 commit comments

Comments
 (0)