@@ -27,41 +27,30 @@ jobs:
2727 id : pr-info
2828 run : echo "pr-number=$(cat pr/pr_number)" >> $GITHUB_OUTPUT
2929 reviewdog :
30- if : github.event_name == 'workflow_run'
31- needs :
32- - restore-pr
33- strategy :
34- matrix :
35- include :
36- - tool : ktlint
37- error-format : " %f:%l:%c %m"
38- - tool : detekt
39- error-format : " %f:%l:%c: %m"
30+ if : github.event_name == 'pull_request_target'
4031 permissions :
4132 pull-requests : write
4233 runs-on : ubuntu-latest
4334 steps :
4435 - name : ' Checkout Repository'
4536 uses : actions/checkout@v4
46- - name : Download style reports
47- uses : dawidd6/action-download-artifact@v6
48- with :
49- name : style-reports
50- path : reports/
51- run_id : ${{ github.event.workflow_run.id }}
37+ - name : Setup format tools
38+ run : |
39+ export DETEKT_VERSION=$(./gradlew --console plain -q printDetektVersion)
40+ export KTLINT_VERSION=$(./gradlew --console plain -q printKtlintVersion)
41+ ./scripts/install-format-tools.sh
5242 - name : Setup reviewdog
5343 uses : reviewdog/action-setup@v1
5444 with :
5545 reviewdog_version : latest
56- - name : Run reviewdog ${{ matrix.tool }}
57- env :
58- GITHUB_ACTIONS : " " # make reviewdog think that we are not in GitHub
59- REVIEWDOG_GITHUB_API_TOKEN : ${{ secrets.GITHUB_TOKEN }}
60- CI_PULL_REQUEST : ${{ needs.restore-pr.outputs.pr-number }}
61- CI_REPO_OWNER : ${{ github.repository_owner }}
62- CI_REPO_NAME : ${{ github.event.repository.name }}
63- CI_COMMIT : ${{ github.event.workflow_run.head_sha }}
64- run : echo reports/${{ matrix.tool }}-reviewdog.out | reviewdog -tee -reporter=github-pr-review -name=${{ matrix.tool }} -efm="${{ matrix.error-format }}"
46+ - name : ' Checkout PR'
47+ uses : actions/checkout@v4
48+ with :
49+ repository : ${{ github.event.pull_request.head.repo.full_name }}
50+ ref : ${{ github.event.pull_request.head.ref }}
51+ - name : Run reviewdog
52+ run : reviewdog -tee -reporter=github-pr-review
53+
6554 danger-check :
6655 if : github.event_name == 'pull_request_target'
6756 runs-on : ubuntu-latest
0 commit comments