List changes in cloned repository

scenario: source code is on github and the pipeline is on gitlab.
on every pipeline run: script clones repository and do some operations. main goal is to identify changed directories. i tried git diff --quiet HEAD^ HEAD – “$dirs” , it works only in case if all changes are with one commit and than pushed. if there is many commits before push operation . accordingly my git diff command only return last modified folder.
what could be workaround ? p.s gitlab pipline triggered from github action, on push operations.