File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,24 @@ jobs:
1414
1515 steps :
1616 - name : Check out code
17- uses : actions/checkout@v3
17+ uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
1820
1921 - name : Check changed files and conditionally trigger CI
2022 env :
23+ base_repo : ${{ github.event.pull_request.base.repo.clone_url }}
24+ base_branch : ${{ github.event.pull_request.base.ref }}
25+ base_branch_pre : " upstream"
26+ diff_branch : ${{ github.event.pull_request.head.ref }}
2127 REPO_TOKEN : ${{ secrets.WANGZELIN_TOKEN }}
2228 run : |
23- FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
29+ set -x
30+ git fetch "$base_repo" "$base_branch":"$base_branch_pre"/"$base_branch"
31+ git checkout "$base_branch_pre"/"$base_branch"
32+ git checkout "$diff_branch"
33+
34+ FILES=$(git --no-pager diff --name-only --diff-filter=ACMRT "$base_branch_pre"/"$base_branch"..."$diff_branch")
2435 echo "Changed files:"
2536 echo "$FILES"
2637
You can’t perform that action at this time.
0 commit comments