1+ name : " Check PR complains with requirements"
2+
3+ on :
4+ pull_request_target :
5+ workflow_run :
6+ workflows : ['Run tests for PR']
7+ types : [completed]
8+
9+ concurrency :
10+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.workflow_run.pull_requests[0].number }}
11+ cancel-in-progress : true
12+
13+ jobs :
14+ reviewdog :
15+ if : github.event_name == 'workflow_run'
16+ strategy :
17+ matrix :
18+ include :
19+ - tool : ktlint
20+ - tool : detekt
21+ permissions :
22+ pull-requests : write
23+ runs-on : ubuntu-latest
24+ steps :
25+ - name : ' Checkout Repository'
26+ uses : actions/checkout@v4
27+ - name : Download benchmark results
28+ uses : dawidd6/action-download-artifact@v6
29+ with :
30+ name : style-reports
31+ path : reports/
32+ run_id : ${{ github.event.workflow_run.id }}
33+ - name : Setup reviewdog
34+ uses : reviewdog/action-setup@v1
35+ with :
36+ reviewdog_version : latest
37+ - name : Run reviewdog ${{ matrix.tool }}
38+ env :
39+ REVIEWDOG_GITHUB_API_TOKEN : ${{ secrets.GITHUB_TOKEN }}
40+ CI_PULL_REQUEST : ${{ github.event.pull_request[0].number }}
41+ CI_REPO_OWNER : ${{ github.repository_owner }}
42+ CI_REPO_NAME : ${{ github.event.repository.name }}
43+ CI_COMMIT : ${{ github.event.workflow_run.pull_requests[0].head.repo }}
44+ run : echo reports/${{ matrix.tool }}-reviewdog.out | reviewdog -tee -reporter=github-pr-review
45+ danger-check :
46+ if : github.event_name == 'pull_request_target'
47+ runs-on : ubuntu-latest
48+ permissions :
49+ pull-requests : write
50+ statuses : write
51+ steps :
52+ - name : ' Checkout Repository'
53+ uses : actions/checkout@v4
54+ - name : Danger
55+ uses : danger/kotlin@1.3.1
56+ with :
57+ run-mode : ci
58+ dangerfile : Dangerfile.df.kts
59+ env :
60+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61+ upload-coverage :
62+ runs-on : ubuntu-latest
63+ if : github.event.workflow_run.actor.name != 'dependabot[bot]' && github.repository == 'OptimumCode/json-schema-validator' && github.event.workflow_run.conclusion == 'success'
64+ steps :
65+ - name : ' Checkout Repository'
66+ uses : actions/checkout@v4
67+ with :
68+ repository : ${{ github.event.workflow_run.head_repository.full_name }}
69+ ref : ${{ github.event.workflow_run.head_sha }}
70+ - name : Download benchmark results
71+ uses : dawidd6/action-download-artifact@v6
72+ with :
73+ name : coverage-reports
74+ path : reports/
75+ run_id : ${{ github.event.workflow_run.id }}
76+ - name : Upload coverage reports to Codecov
77+ uses : codecov/codecov-action@v4
78+ with :
79+ override_branch : ${{ github.event.workflow_run.pull_requests[0].head.ref }}
80+ override_commit : ${{ github.event.workflow_run.pull_requests[0].head.sha }}
81+ override_pr : ${{ github.event.workflow_run.pull_requests[0].number }}
82+ token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments