@@ -220,6 +220,7 @@ jobs:
220
220
workflow_path : ${{ steps.set_workflow_path.outputs.workflow_path }}
221
221
sha_everest_ci : ${{ steps.set_sha_everest_ci.outputs.sha }}
222
222
tag_everest_ci : ${{ steps.set_tag_everest_ci.outputs.latest_tag }}
223
+ is_fork : ${{ steps.is_fork.outputs.is_fork }}
223
224
steps :
224
225
- name : Determine workflow_path
225
226
id : set_workflow_path
@@ -265,6 +266,24 @@ jobs:
265
266
fi
266
267
267
268
echo "latest_tag=$TAG" >> $GITHUB_OUTPUT
269
+ - name : Determine whether the PR comes from fork
270
+ id : is_fork
271
+ run : |
272
+ if [ "${{ github.event_name }}" == "pull_request" ]; then
273
+ if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
274
+ is_fork=true
275
+ else
276
+ is_fork=false
277
+ fi
278
+ else
279
+ is_fork=false
280
+ fi
281
+ echo "is_fork=${is_fork}" >> $GITHUB_OUTPUT
282
+ if [ "${is_fork}" == "true" ]; then
283
+ echo "This is a forked PR"
284
+ else
285
+ echo "This is not a forked PR"
286
+ fi
268
287
269
288
build-the-build-kit :
270
289
name : Build build-kit
@@ -414,7 +433,7 @@ jobs:
414
433
path : ${{ inputs.coverage_xml_path}}
415
434
- name : Deploy html coverage report
416
435
id : deploy_coverage_report
417
- if : ${{ steps.run_coverage.outcome == 'success' || steps.run_coverage.outcome == 'failure' }}
436
+ if : ${{ ( steps.run_coverage.outcome == 'success' || steps.run_coverage.outcome == 'failure' ) && needs.setup-env.outputs.is_fork == 'false ' }}
418
437
uses : ./everest-ci/github-actions/deploy-ci-artifact
419
438
with :
420
439
target_repo : ${{ inputs.artifact_deploy_target_repo }}
@@ -571,6 +590,7 @@ jobs:
571
590
anybadge -o --label Coverage --value ${{ steps.parse_coverage_report.outputs.line_coverage_percentage }} -s "%" --file ${{ github.workspace }}/coverage-badge/coverage-badge.svg 20=red 40=orange 60=yellow 80=yellowgreen 100=green
572
591
- name : Deploy coverage badge
573
592
uses : ./everest-ci/github-actions/deploy-ci-artifact
593
+ if : ${{ needs.setup-env.outputs.is_fork == 'false' }}
574
594
with :
575
595
target_repo : ${{ inputs.artifact_deploy_target_repo }}
576
596
github_token : ${{ secrets.coverage_deploy_token }}
@@ -585,6 +605,7 @@ jobs:
585
605
path : coverage-report
586
606
- name : Deploy html coverage report
587
607
uses : ./everest-ci/github-actions/deploy-ci-artifact
608
+ if : ${{ needs.setup-env.outputs.is_fork == 'false' }}
588
609
with :
589
610
target_repo : ${{ inputs.artifact_deploy_target_repo }}
590
611
github_token : ${{ secrets.coverage_deploy_token }}
0 commit comments