You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- cron: '0 0 1 * *'# run at midnight, on day 1 of the month
5
+
- cron: '0 0 1 * *'# run at midnight, on day 1 of the month
11
6
workflow_dispatch:
12
7
13
8
jobs:
@@ -20,87 +15,67 @@ jobs:
20
15
- uses: actions/checkout@v3
21
16
with:
22
17
fetch-depth: '0'
23
-
- name: Check consistency
18
+
- name: Check consistency and create issue
24
19
id: check-consistency
20
+
env:
21
+
GH_TOKEN: ${{ github.token }}
25
22
run: |
26
-
# Set the issue header
27
-
issue="\
28
-
# i18n Contents Consistency Issue\\n\
29
-
\\n\
30
-
The following files may have consistency issues with the English version. Please check and update the files.\\n\
31
-
\\n\
32
-
This issue is created when there is an update to content/en. It compares the git update history to let you know what updates are overdue. The issue should be closed when the update is complete.\\n"
33
-
34
-
# Loop through all the files in the English directory
35
-
for file in $(find patterns/2-structured -name '*.md'); do
36
-
37
-
# Get the translated file name and check if it exists
38
-
i18n_filename=$(echo "$file" | sed 's/patterns\/2-structured/translation\/${{matrix.language}}\/patterns/g')
23
+
# Declare the flags
24
+
declare -A flags=( ["ja"]=":jp: Japanese" ["zh"]=":cn: Chinese")
The following files may have consistency issues with the English version. Please check and update the files.
33
+
34
+
This issue is created when there is an update to content/en. It compares the git update history to let you know what updates are overdue. The issue should be closed when the update is complete.
35
+
EOM
36
+
37
+
# Loop through all files in the English directory
38
+
for file in $(find patterns/{2-structured,3-validated} -name '*.md'); do
39
+
[[ $file =~ "3-validated" ]] && continue # if the file is under 3-validated, skip (one liner) - 2023/08/26
40
+
i18n_filename=$(echo "$file" | sed "s/patterns\/\(2-structured\|3-validated\)/translation\/${{matrix.language}}\/patterns/g")
41
+
39
42
if [[ ! -e "$i18n_filename" ]]; then
40
-
continue
43
+
continue
41
44
fi
42
-
echo $file
43
-
echo $i18n_filename
44
-
45
-
# Get the last updated date of the original file and the translated file
For more information, please compare [the original file(en)](https://github.com/$GITHUB_REPOSITORY/blob/master/$file) with[the translated file](https://github.com/$GITHUB_REPOSITORY/blob/master/$i18n_filename) . You can view [the differences](https://github.com/yuhattor/innersourcecommons.org/compare/$i18n_last_update_hash...$original_last_update_hash) on GitHub. The number of days since overdue updates is **$days_since_overdue_updates** days.
0 commit comments