Skip to content

Commit 90d12c3

Browse files
committed
refactor bash script.
Signed-off-by: alyssacgoins <[email protected]>
1 parent 3e96539 commit 90d12c3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/resources/scripts/get_components_for_validation.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ echo "Using HEAD_COMMIT: ${HEAD_COMMIT}"
3030
# If diff is detected within the input script directory, validate all components.
3131
SCRIPT_DIFF=$(git diff --name-only --diff-filter=ACM "${COMMIT_RANGE}" -- "${SCRIPT_DIR}" || true)
3232
if [[ -n "${SCRIPT_DIFF}" ]]; then
33-
echo "Changes detected in critical script directory: ${SCRIPT_DIR}"
3433
ALL_COMPONENT_FILES=$(find components -mindepth 2 -maxdepth 2 -type d | \
3534
sort -u | \
3635
tr '\n' ',' | \
3736
sed 's/,$//')
3837

39-
echo "Changes detected in ${VALIDATION_SCRIPT_DIR}. All existing components will be validated: ${ALL_COMPONENT_FILES}"
38+
if [[ -n "${ALL_COMPONENT_FILES}" ]]; then
39+
echo "Changes detected in ${VALIDATION_SCRIPT_DIR}. There are no existing components to validate."
40+
else
41+
echo "Changes detected in ${VALIDATION_SCRIPT_DIR}. All existing components will be validated: ${ALL_COMPONENT_FILES}"
42+
fi
43+
4044
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
4145
echo "new_components_list=${ALL_COMPONENT_FILES}" >> "${GITHUB_OUTPUT}"
4246
else

0 commit comments

Comments
 (0)