File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,14 +38,29 @@ jobs:
3838 name: 'run validation'
3939 })
4040
41- - name : Checkout code
41+ - name : Checkout base branch to get latest validation script
42+ uses : actions/checkout@v4
43+ with :
44+ ref : ${{ github.base_ref }}
45+ fetch-depth : 0
46+ path : base-repo
47+
48+ - name : Checkout PR code
4249 uses : actions/checkout@v4
4350 with :
4451 ref : ${{ github.event.pull_request.head.sha }}
4552 fetch-depth : 0
53+ path : pr-repo
54+
55+ - name : Copy validation script from base branch
56+ run : |
57+ mkdir -p pr-repo/.github/scripts/
58+ cp base-repo/.github/scripts/validate-pull-request.js pr-repo/.github/scripts/
59+ cd pr-repo
4660
4761 - name : Get changed files
4862 id : changed-files
63+ working-directory : pr-repo
4964 uses : tj-actions/changed-files@v41
5065 with :
5166 files : ' **/*'
5873 node-version : ' 18'
5974
6075 - name : Validate pull request and post comment
76+ working-directory : pr-repo
6177 env :
6278 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6379 GITHUB_REPOSITORY : ${{ github.repository }}
You can’t perform that action at this time.
0 commit comments