Skip to content

Commit c27c5a3

Browse files
committed
chore: refine Auth0 CLI action
1 parent ebb55a2 commit c27c5a3

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

β€Ž.github/actions/configure-auth0-screens/action.ymlβ€Ž

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ runs:
118118
if [ ! -d "$SCREEN_ASSETS_DIR" ]; then
119119
echo "::error::Screen directory not found: $SCREEN_ASSETS_DIR"
120120
FAILED_SCREENS+=("$screen")
121-
# Note: The DEBUG line for FAILED_SCREENS was here in a previous version for debugging that array.
122-
# Keeping it or removing it depends on current debugging needs for FAILED_SCREENS.
123-
# For this request focused on SETTINGS_FILE, I'll keep it concise.
124121
continue
125122
fi
126123
@@ -170,20 +167,20 @@ runs:
170167
fi
171168
172169
echo "πŸ“ Building configuration for $screen"
173-
CONTEXT_CONFIG='[]' # As per your "working well" script
170+
CONTEXT_CONFIG='[]'
174171
JSON_CONTENT=$(jq -n --arg base_href "${CDN_BASE_URL}/" --argjson cfg "$CONTEXT_CONFIG" '{ rendering_mode: "advanced", context_configuration: $cfg, default_head_tags_disabled: false, head_tags: [ { tag: "base", attributes: { href: $base_href } }, { tag: "meta", attributes: { name: "viewport", content: "width=device-width, initial-scale=1" } } ] }')
175172
if [ $? -ne 0 ]; then echo "::error::Failed to create base JSON content for $screen"; FAILED_SCREENS+=("$screen"); rm -f "$SETTINGS_FILE"; trap - ERR; continue; fi
176173
177174
for css_file in "${SHARED_CSS_FILES[@]}" "${SCREEN_CSS_FILES[@]}"; do css_basename=$(basename "$css_file"); if [[ ! "$css_basename" =~ ^[^a-zA-Z0-9] ]]; then relative_path="${css_file#dist/}"; JSON_CONTENT=$(echo "$JSON_CONTENT" | jq --arg url "${CDN_BASE_URL}/${relative_path}" '.head_tags += [{ tag: "link", attributes: { rel: "stylesheet", href: $url } }]'); fi; done
178175
NON_ENTRY_JS_FILES=()
179176
for js_file in "${SCREEN_JS_FILES[@]}"; do if [ "$js_file" != "$SCREEN_ENTRY_FILE" ]; then NON_ENTRY_JS_FILES+=("$js_file"); fi; done
180-
for js_file in "${ROOT_JS_FILES[@]}" "${SHARED_JS_FILES[@]}" "${NON_ENTRY_JS_FILES[@]}" "$SCREEN_ENTRY_FILE"; do js_basename=$(basename "$js_file"); if [[ ! "$js_basename" =~ ^[^a-zA-Z0-9] ]]; then relative_path="${js_file#dist/}"; JSON_CONTENT=$(echo "$JSON_CONTENT" | jq --arg url "${CDN_BASE_URL}/${relative_path}" '.head_tags += [{ tag: "script", attributes: { src: $url, type: "module" } }]'); fi; done
177+
for js_file in "${ROOT_JS_FILES[@]}" "${SHARED_JS_FILES[@]}" "${NON_ENTRY_JS_FILES[@]}" "$SCREEN_ENTRY_FILE"; do js_basename=$(basename "$js_file"); if [[ ! "$js_basename" =~ ^[^a-zA-Z0-9] ]]; then relative_path="${js_file#dist/}"; JSON_CONTENT=$(echo "$JSON_CONTENT" | jq --arg url "${CDN_BASE_URL}/${relative_path}" '.head_tags += [{ tag: "script", attributes: { src: $url } }]'); fi; done
181178
182179
echo "$JSON_CONTENT" > "$SETTINGS_FILE" || { echo "::error::Failed to write settings file for $screen"; FAILED_SCREENS+=("$screen"); rm -f "$SETTINGS_FILE"; trap - ERR; continue; }
183180
184-
echo "Debug: Content of SETTINGS_FILE for screen $screen:" # <<< UNCOMMENTED
185-
cat "$SETTINGS_FILE" # <<< UNCOMMENTED
186-
echo "--- End of SETTINGS_FILE content ---" # <<< UNCOMMENTED
181+
echo "Debug: Content of SETTINGS_FILE for screen $screen:"
182+
cat "$SETTINGS_FILE"
183+
echo "--- End of SETTINGS_FILE content ---"
187184
188185
echo "πŸ”„ Configuring Auth0 prompt: $screen"
189186
if ! command -v auth0 &> /dev/null; then echo "::error::auth0 CLI not found"; FAILED_SCREENS+=("$screen"); rm -f "$SETTINGS_FILE"; trap - ERR; continue; fi
@@ -238,9 +235,9 @@ runs:
238235
fi
239236
240237
echo "πŸ“ˆ Auth0 ACUL Screens Deployment Summary"
241-
echo "β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”"
242-
echo "β”‚ Screen β”‚ Status β”‚"
243-
echo "β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€"
238+
echo "β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”"
239+
echo "β”‚ Screen β”‚ Status β”‚"
240+
echo "β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€"
244241
245242
ALL_BUILT_SCREENS_ARRAY=()
246243
mapfile -t ALL_BUILT_SCREENS_ARRAY < <(echo "$SCREENS_JSON" | jq -r '.[]')
@@ -270,7 +267,7 @@ runs:
270267
printf "β”‚ %-14s β”‚ %-7s β”‚\n" "$screen_item" "$status_string"
271268
done
272269
273-
echo "β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜"
270+
echo "β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜"
274271
275272
echo "- Successfully configured: $deployed_screens_output"
276273
echo "- Failed to configure: $failed_screens_output"

0 commit comments

Comments
Β (0)