-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1.52 KB
/
progress.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
name: Check Translation Progress
on:
push:
branches:
- master
jobs:
count_file_list:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set Envirionment Variables
run: |
export JAVA_FILE_COUNT=$(cat ./_data/JavaRuleList.txt | wc -l)
export TOTAL_JAVA_FILE_COUNT=$(ls -1 ./_posts/java | grep -f ./_data/JavaRuleList.txt | wc -l)
export PYTHON_FILE_COUNT=$(cat ./_data/PythonRuleList.txt | wc -l)
export TOTAL_PYTHON_FILE_COUNT=$(ls -1 ./_posts/python | grep -f ./_data/PythonRuleList.txt | wc -l)
export K8S_FILE_COUNT=$(ls -1 ./_posts/kubernetes | grep -f ./_data/KubernetesRuleList.txt | wc -l)
export TOTAL_K8S_FILE_COUNT=$(find . -type f -name '*.yaml' -o -name '*.yml' | grep -v './vendor/' | grep -i 'k8s' | wc -l)
- name: Update README
run: |
sed -i "s/{{JAVA_FILE_COUNT}}/$JAVA_FILE_COUNT/g" README.md
sed -i "s/{{TOTAL_JAVA_FILE_COUNT}}/$TOTAL_JAVA_FILE_COUNT/g" README.md
sed -i "s/{{PYTHON_FILE_COUNT}}/$PYTHON_FILE_COUNT/g" README.md
sed -i "s/{{TOTAL_PYTHON_FILE_COUNT}}/$TOTAL_PYTHON_FILE_COUNT/g" README.md
sed -i "s/{{K8S_FILE_COUNT}}/$K8S_FILE_COUNT/g" README.md
sed -i "s/{{TOTAL_K8S_FILE_COUNT}}/$TOTAL_K8S_FILE_COUNT/g" README.md
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update README with variable values"