|
23 | 23 | fetch-depth: 0 |
24 | 24 | path: baseline |
25 | 25 |
|
| 26 | + - name: Checkout PR branch |
| 27 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v5 |
| 28 | + with: |
| 29 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 30 | + ref: ${{ github.event.pull_request.head.sha }} |
| 31 | + fetch-depth: 0 |
| 32 | + path: current |
| 33 | + |
| 34 | + - name: Compute merge-base commit |
| 35 | + id: merge-base |
| 36 | + run: | |
| 37 | + cd baseline |
| 38 | + # For fork PRs, fetch PR head from the local current/ checkout |
| 39 | + git fetch "${GITHUB_WORKSPACE}/current" HEAD --no-tags 2>/dev/null || true |
| 40 | + MERGE_BASE=$(git merge-base ${{ github.event.pull_request.base.ref }} ${{ github.event.pull_request.head.sha }}) |
| 41 | + echo "Merge-base commit: ${MERGE_BASE}" |
| 42 | + echo "sha=${MERGE_BASE}" >> "$GITHUB_OUTPUT" |
| 43 | + BASE_HEAD=$(git rev-parse ${{ github.event.pull_request.base.ref }}) |
| 44 | + if [ "${MERGE_BASE}" != "${BASE_HEAD}" ]; then |
| 45 | + echo "::notice::PR is not rebased on latest ${{ github.event.pull_request.base.ref }}. Using merge-base ${MERGE_BASE} as baseline (branch HEAD: ${BASE_HEAD})." |
| 46 | + fi |
| 47 | +
|
| 48 | + - name: Reset baseline to merge-base |
| 49 | + working-directory: baseline |
| 50 | + run: git checkout ${{ steps.merge-base.outputs.sha }} |
| 51 | + |
26 | 52 | - name: Set up JDK 21 |
27 | 53 | uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 |
28 | 54 | with: |
|
33 | 59 | working-directory: baseline |
34 | 60 | run: ./gradlew :fineract-provider:resolve --no-daemon |
35 | 61 |
|
36 | | - - name: Checkout PR branch |
37 | | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v5 |
38 | | - with: |
39 | | - repository: ${{ github.event.pull_request.head.repo.full_name }} |
40 | | - ref: ${{ github.event.pull_request.head.sha }} |
41 | | - fetch-depth: 0 |
42 | | - path: current |
43 | | - |
44 | 62 | - name: Generate PR spec |
45 | 63 | working-directory: current |
46 | 64 | run: ./gradlew :fineract-provider:resolve --no-daemon |
|
0 commit comments