Skip to content

Commit

Permalink
Fixed changed subproject detection
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianboguszewski committed Nov 29, 2024
1 parent f6500e4 commit 7ec2d94
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/sanity-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ jobs:
fetch-depth: 0
- name: Determine subprojects to test
run: |
# Ensure the directories are passed correctly to the environment variable
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# Get unique subproject directories from changed files in PR
subproject_dirs=$(git diff --name-only origin/master..HEAD | grep '^demos/' | xargs -I{} dirname "{}" | sort -u)
subproject_dirs=$(git diff --name-only origin/master..HEAD | grep '^demos/' | xargs -I{} dirname "{}" | sort -u | tr '\n' ' ')
else
# For scheduled runs, process all subprojects
subproject_dirs=$(find demos -type d -mindepth 1 -maxdepth 1 ! -name utils)
subproject_dirs=$(find demos -mindepth 1 -maxdepth 1 -type d ! -name utils | tr '\n' ' ')
fi
echo "subproject_dirs=$subproject_dirs" >> $GITHUB_ENV
- name: Categorize subprojects
Expand All @@ -42,7 +41,7 @@ jobs:
webcam=()
js=()
for dir in ${{ env.subproject_dirs }}; do
for dir in $subproject_dirs; do
if [ -f "$dir/package.json" ]; then
js+=("$dir")
elif [ -f "$dir/main.ipynb" ]; then
Expand Down

0 comments on commit 7ec2d94

Please sign in to comment.