Skip to content

Commit cdefa53

Browse files
authored
Stop posting reports in PRs not on master (#8986)
This is to fix #8985 Reports will not be posted to PRs rooted from master in presubmirs, but data will still be uploaded in postsubmits.
1 parent a58bf1a commit cdefa53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/health-metrics-presubmit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
needs: check
5454
# Prevent the job from being triggered in fork.
5555
# always() will trigger this job when `needs` are skipped in a `merge` pull_request event.
56-
if: always() && github.event.pull_request.head.repo.full_name == github.repository && (github.event.action != 'closed' || github.event.pull_request.merged)
56+
if: always() && github.event.pull_request.head.repo.full_name == github.repository && ((github.event.action != 'closed' && github.event.pull_request.base.ref == 'master') || github.event.pull_request.merged)
5757
runs-on: macos-11
5858
strategy:
5959
matrix:
@@ -334,7 +334,7 @@ jobs:
334334
with:
335335
path: /Users/runner/test
336336
- name: Compare Diff and Post a Report
337-
if: github.event.pull_request.merged != true && github.event.action != 'closed' && github.event.pull_request.head.repo.full_name == github.repository
337+
if: github.event.pull_request.merged != true && github.event.action != 'closed' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.ref == 'master'
338338
env:
339339
base_commit: ${{ needs.check.outputs.target_branch_head }}
340340
run: |

0 commit comments

Comments
 (0)