File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,19 @@ jobs:
1515 steps :
1616 - name : Checkout repository
1717 uses : actions/checkout@v5
18- with :
19- ref : ${{ github.event.workflow_run.head_branch }}
2018
2119 - name : Check for Solutions/ changes
2220 id : changes
2321 run : |
24- git fetch origin ${{ github.event.workflow_run.head_sha }}
25- git diff --name-only ${{ github.event.workflow_run.head_sha }}^ ${{ github.event.workflow_run.head_sha }} > files.txt
22+ git fetch --depth=2 origin ${{ github.ref_name }}
23+ if git rev-parse HEAD^ >/dev/null 2>&1; then
24+ # Normal commit (has a parent)
25+ git diff --name-only HEAD^ HEAD > files.txt
26+ else
27+ # Root commit (no parent)
28+ git show --name-only --pretty="" HEAD > files.txt
29+ fi
30+
2631 if grep -q '^Solutions/' files.txt; then
2732 echo "changed=true" >> $GITHUB_OUTPUT
2833 else
You can’t perform that action at this time.
0 commit comments