forked from learning-process/parallel_programming_course
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.42 KB
/
c2c-ratio-pr.yml
File metadata and controls
51 lines (43 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Comment-to-code (C2C) ratio
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: >-
${{ github.ref != 'refs/heads/master' &&
github.event_name != 'merge_group' &&
!startsWith(github.ref, 'refs/heads/gh-readonly-queue') }}
permissions:
contents: read
jobs:
comment-to-code-ratio:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install cloc
run: npm install --global cloc
- name: Generate report
continue-on-error: true
uses: deep5050/comment-to-code-ratio-action@v1.0.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
issue_number: ${{ github.event.pull_request.number }}
options: >-
--quiet
--git
--diff
${{ github.event.pull_request.base.sha }}
${{ github.event.pull_request.head.sha }}
--md
--out=report.md
--exclude-dir=.git,3rdparty,build
- name: Check ratio
id: ratio
run: python3 scripts/check_comment_to_code_ratio.py report.md --limit 10
- name: Print final percentage
if: always()
run: |
echo "Comment percentage for PR changes: ${{ steps.ratio.outputs.comment_percentage || 'N/A' }}%"