File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 28
28
performance_run_job : ${{ steps.check_files.outputs.performance_run_job }}
29
29
remoteconfig_run_job : ${{ steps.check_files.outputs.remoteconfig_run_job }}
30
30
storage_run_job : ${{ steps.check_files.outputs.storage_run_job }}
31
- base_commit : ${{ steps.check_files.outputs.base_commit }}
31
+ target_branch_head : ${{ steps.check_files.outputs.target_branch_head }}
32
32
runs-on : ubuntu-latest
33
33
steps :
34
34
- name : Checkout code
47
47
binary_size_metrics :
48
48
needs : check
49
49
# Prevent the job from being triggered in fork.
50
- if : always() && github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged
50
+ if : always() && github.repository == 'Firebase/firebase-ios-sdk'
51
51
runs-on : macos-11
52
52
strategy :
53
53
matrix :
82
82
./scripts/health_metrics/create_binary_size_report.sh
83
83
env :
84
84
PULL_REQUEST_NUM : ${{ github.event.pull_request.number }}
85
- BASE_COMMIT : ${{ github.event.pull_request.base.sha }}
85
+ BASE_COMMIT : ${{ needs.check.outputs.target_branch_head }}
86
86
POSTSUBMIT : ${{ github.event.pull_request.merged }}
87
87
SOURCE_BRANCH : ${{ github.base_ref }}
88
88
@@ -326,7 +326,7 @@ jobs:
326
326
- name : Compare Diff and Post a Report
327
327
if : github.event.pull_request.merged != true && github.event.action != 'closed' && github.event.pull_request.head.repo.full_name == github.repository
328
328
env :
329
- base_commit : ${{ github.event.pull_request.base.sha }}
329
+ base_commit : ${{ needs.check.outputs.target_branch_head }}
330
330
run : |
331
331
# Get Head commit of the branch, instead of a merge commit created by actions/checkout.
332
332
if [ -d "${{steps.download.outputs.download-path}}" ]; then
Original file line number Diff line number Diff line change @@ -17,15 +17,17 @@ set -ex
17
17
# Updates in a pull request will generate a code coverage report in a PR.
18
18
19
19
# Get most rescent ancestor commit.
20
- common_commit=$( git merge-base remotes/origin/${pr_branch} remotes/origin/master)
20
+ common_commit=$( git merge-base remotes/origin/${pr_branch} remotes/origin/${GITHUB_BASE_REF} )
21
+ target_branch_head=$( git rev-parse remotes/origin/${GITHUB_BASE_REF} )
21
22
echo " The common commit is ${common_commit} ."
22
- # Set base commit and this will be used to compare diffs of coverage to the current commit.
23
- echo " ::set-output name=base_commit::${common_commit} "
23
+ echo " The target branch head commit is ${target_branch_head} ."
24
+ # Set target branch head and this will be used to compare diffs of coverage to the current commit.
25
+ echo " ::set-output name=target_branch_head::${target_branch_head} "
24
26
25
27
cd scripts/health_metrics/generate_code_coverage_report
26
28
27
- # List changed file from the base commit. This is generated by comparing the
28
- # head of the branch and the common commit from the master branch.
29
- git diff --name-only $common_commit remotes/origin/${pr_branch } > updated_files.txt
29
+ # List changed file from the merged commit. This is generated by comparing the
30
+ # merge commit to the head commit from the target branch.
31
+ git diff --name-only remotes/origin/${GITHUB_BASE_REF} ${GITHUB_SHA } > updated_files.txt
30
32
31
33
swift run UpdatedFilesCollector --changed-file-paths updated_files.txt --code-coverage-file-patterns ../code_coverage_file_list.json
You can’t perform that action at this time.
0 commit comments