Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated filter_dirs cmd #1097

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/scripts/changed-modules2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ changed_dirs=$(git diff origin/main...HEAD --name-only)
# Eliminate the last segment of each path
top_level_and_files=$(echo "$changed_dirs" | xargs -n1 dirname | sort -u)

# Extract only the top-level and second-level directories
filtered_dirs=$(echo "$top_level_and_files" | awk -F'/' '{if (NF <= 2) print $0}')

# Eliminate directories with more than 2 slashes
filtered_dirs=$(echo "$top_level_and_files" | grep -v '.*/.*/.*')
# filtered_dirs=$(echo "$top_level_and_files" | grep -v '.*/.*/.*')

# Get one-level directories
one_level_dirs=$(echo "$filtered_dirs" | cut -d'/' -f1 | sort -u)
Expand Down
Loading