-
-
Notifications
You must be signed in to change notification settings - Fork 5
82 lines (68 loc) · 2.29 KB
/
calculate-metrics.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Calculate Metrics
on:
workflow_dispatch:
push:
branches: [main]
paths:
- tldr/
- .github/workflows/calculate-metrics.yml
- scripts/*.sh
- scripts/*.py
- '!scripts/sort-lychee-output.py'
jobs:
calculate-metrics:
runs-on: ubuntu-latest
name: Calculate Metrics
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: true
- uses: actions/setup-python@v5
if: github.ref == 'refs/heads/main'
with:
python-version: '3.12'
cache: 'pip'
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install npm dependencies
run: npm install -g markdownlint-cli tldr-lint
- name: Install pip dependencies
if: github.ref == 'refs/heads/main'
run: pip install -r requirements.txt && rm -f requirements.txt
- name: Run the script and generate artifacts
run: |
./scripts/calculate-metrics.sh 2>&1 | tee metrics-log.md
cat metrics-log.md >> $GITHUB_STEP_SUMMARY
- name: Upload Calculate Metrics artifact
uses: actions/upload-artifact@v4
with:
name: metrics
path: |
metrics-log.md
*.txt
check-pages*/
- name: Create metrics.zip
if: github.ref == 'refs/heads/main'
run: zip -r metrics.zip metrics-log.md *.txt check-pages*/
- name: Upload artifacts to GitHub Release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
with:
tag_name: latest
files: |
metrics-log.md
*.txt
metrics.zip
- name: Update Translation Dashboard Status Issue
if: github.repository == 'tldr-pages/tldr-maintenance' && github.ref == 'refs/heads/main'
run: python3 scripts/update-dashboard-issue.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Language-specific Translation Dashboard Status Issues
if: github.repository == 'tldr-pages/tldr-maintenance' && github.ref == 'refs/heads/main'
run: python3 scripts/update-language-issues.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}