fix changed-file detection where GITHUB_EVENT_NAME=pull_request
@@ -29,7 +29,13 @@ fi
repo=$(cd "$(dirname "$0")/.." && pwd)
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
- files="$(git diff --diff-filter=d --name-only remotes/origin/main | grep "exercises/" | cut -d '/' -f -2 | sort -u | awk -v repo=$repo '{print repo"/"$1}')"
+ files="$(
+ git diff --diff-filter=d --name-only remotes/origin/main |
+ grep "exercises/" |
+ cut -d '/' -f -3 |
+ sort -u |
+ awk -v repo=$repo '{print repo"/"$1}'
+ )"
else
files=$repo/exercises/*/*
fi
