1818
1919 # Allow this workflow to be called as a reusable workflow
2020 workflow_call :
21+ inputs :
22+ commit_range_start :
23+ description : ' The start commit of the range to check for incremental builds.'
24+ type : string
25+ required : false
26+ commit_range_end :
27+ description : ' The end commit of the range to check for incremental builds.'
28+ type : string
29+ required : false
2130
2231env :
2332 DOTNET_VERSION : ${{ '9.0.x' }}
4655 uses : actions/checkout@v4
4756 with :
4857 submodules : recursive
58+ ref : ${{ inputs.commit_range_end || github.sha }}
59+ fetch-depth : 0
60+ fetch-tags : true
4961
5062 # Restore Tools from Manifest list in the Repository
5163 - name : Restore dotnet tools
@@ -84,11 +96,13 @@ jobs:
8496 uses : actions/checkout@v4
8597 with :
8698 submodules : recursive
99+ ref : ${{ inputs.commit_range_end || github.sha }}
87100 fetch-depth : 0
101+ fetch-tags : true
88102
89103 - name : Get changed components
90104 run : |
91- $changedComponents = $(./tooling/Get-Changed-Components.ps1 ${{ github.event.before }} ${{ github.event.after }})
105+ $changedComponents = $(./tooling/Get-Changed-Components.ps1 ${{ inputs.commit_range_start || github.event.before }} ${{ inputs.commit_range_end || github.event.after }})
92106 $buildableChangedComponents = $(./tooling/MultiTarget/Filter-Supported-Components.ps1 -Components $changedComponents -MultiTargets ${{ matrix.multitarget }} -WinUIMajorVersion ${{ matrix.winui }})
93107 echo "CHANGED_COMPONENTS_LIST=$(($buildableChangedComponents | ForEach-Object { "$_" }) -join ',')" >> $env:GITHUB_ENV
94108 echo "HAS_BUILDABLE_COMPONENTS=$($buildableChangedComponents.Count -gt 0)" >> $env:GITHUB_ENV
@@ -248,7 +262,9 @@ jobs:
248262 uses : actions/checkout@v4
249263 with :
250264 submodules : recursive
265+ ref : ${{ inputs.commit_range_end || github.sha }}
251266 fetch-depth : 0
267+ fetch-tags : true
252268
253269 - name : Format Date/Time of Commit for Package Version
254270 run : |
@@ -275,7 +291,7 @@ jobs:
275291 # Get changed components
276292 - name : Get changed components
277293 run : |
278- $changedComponents = $(./tooling/Get-Changed-Components.ps1 ${{ github.event.before }} ${{ github.event.after }})
294+ $changedComponents = $(./tooling/Get-Changed-Components.ps1 ${{ inputs.commit_range_start || github.event.before }} ${{ inputs.commit_range_end || github.event.after }})
279295 $buildableChangedComponents = $(./tooling/MultiTarget/Filter-Supported-Components.ps1 -Components $changedComponents -MultiTargets "all" -WinUIMajorVersion ${{ matrix.winui }})
280296 echo "CHANGED_COMPONENTS_LIST=$(($buildableChangedComponents | ForEach-Object { "$_" }) -join ',')" >> $env:GITHUB_ENV
281297 echo "HAS_BUILDABLE_COMPONENTS=$($buildableChangedComponents.Count -gt 0)" >> $env:GITHUB_ENV
@@ -440,6 +456,9 @@ jobs:
440456 uses : actions/checkout@v4
441457 with :
442458 submodules : recursive
459+ ref : ${{ inputs.commit_range_end || github.sha }}
460+ fetch-depth : 0
461+ fetch-tags : true
443462
444463 # Restore Tools from Manifest list in the Repository
445464 - name : Restore dotnet tools
0 commit comments