Skip to content

Commit f6533e1

Browse files
authored
Merge pull request #2546 from cncf/main
[PTBR] Update dev-pt with the main branch
2 parents 1391a6d + f431c13 commit f6533e1

File tree

148 files changed

+2701
-138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+2701
-138
lines changed

.github/auto-comment-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
label_mappings:
2+
- labels:
3+
- hold
4+
comment: Wait, please do not proceed with this yet.
5+
- labels:
6+
- lang/en
7+
comment: To see where this is in the review pipeline and follow the progress, please look at the [definition review board](https://github.com/orgs/cncf/projects/26/views/1).

.github/labeler.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
lang/ar:
2-
- content/ar/*
2+
- content/ar/**
33

44
lang/bn:
5-
- content/bn/*
5+
- content/bn/**
66

77
lang/de:
8-
- content/de/*
8+
- content/de/**
99

1010
lang/en:
11-
- content/en/*
11+
- content/en/**
1212

1313
lang/es:
14-
- content/es/*
14+
- content/es/**
1515

1616
lang/fr:
17-
- content/fr/*
17+
- content/fr/**
1818

1919
lang/hi:
20-
- content/hi/*
20+
- content/hi/**
2121

2222
lang/it:
23-
- content/it/*
23+
- content/it/**
2424

2525
lang/ja:
26-
- content/ja/*
26+
- content/ja/**
2727

2828
lang/ko:
29-
- content/ko/*
29+
- content/ko/**
3030

3131
lang/pt:
32-
- content/pt-br/*
32+
- content/pt-br/**
3333

3434
lang/tw:
35-
- content/zh-tw/*
35+
- content/zh-tw/**
3636

3737
lang/zh:
38-
- content/zh-cn/*
38+
- content/zh-cn/**
3939

4040

.github/settings.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ collaborators:
8383
permission: push
8484

8585
# l10n de approvers
86-
# Note: CathPag is both Maintainer (maintain) and de approver (push)
8786
# Note: iamNoah1 is both Maintainer (maintain) and de approver (push)
8887
- username: DaveVentura
8988
permission: push
@@ -172,6 +171,9 @@ collaborators:
172171
- username: sestegra
173172
permission: push
174173

174+
- username: guillaumebernard84
175+
permission: push
176+
175177
# l10n ur approvers
176178
- username: Saim-Safdar
177179
permission: push
@@ -180,6 +182,12 @@ collaborators:
180182
permission: push
181183

182184
# l10n zh-tw approvers
185+
- username: hwchiu
186+
permission: push
187+
188+
- username: johnlinp
189+
permission: push
190+
183191
- username: pichuang
184192
permission: push
185193

@@ -196,6 +204,9 @@ collaborators:
196204
- username: naonishijima
197205
permission: push
198206

207+
- username: yuichi-nakamura
208+
permission: push
209+
199210
# l10n tr approvers
200211
- username: aliok
201212
permission: push
@@ -209,6 +220,13 @@ collaborators:
209220
- username: eminalemdar
210221
permission: push
211222

223+
# l10n ru approvers
224+
- username: shurup
225+
permission: push
226+
227+
- username: kirkonru
228+
permission: push
229+
212230
branches:
213231

214232
# Default branch of this repository for configurations and English contents
@@ -419,6 +437,7 @@ branches:
419437
- fydrah
420438
- Krast76
421439
- sestegra
440+
- guillaumebernard84
422441
teams: []
423442
enforce_admins: null
424443
required_linear_history: null
@@ -451,6 +470,8 @@ branches:
451470
apps: []
452471
# zh-tw approvers
453472
users:
473+
- hwchiu
474+
- johnlinp
454475
- pichuang
455476
- ydFu
456477
teams: []
@@ -471,6 +492,7 @@ branches:
471492
- inductor
472493
- kaitoii11
473494
- naonishijima
495+
- yuichi-nakamura
474496
teams: []
475497
enforce_admins: null
476498
required_linear_history: null
@@ -493,3 +515,20 @@ branches:
493515
teams: []
494516
enforce_admins: null
495517
required_linear_history: null
518+
519+
# l10n branch for ru contents only
520+
- name: dev-ru
521+
protection:
522+
required_pull_request_reviews:
523+
required_approving_review_count: 2
524+
require_code_owner_reviews: true
525+
required_status_checks: null
526+
restrictions:
527+
apps: []
528+
# ru approvers
529+
users:
530+
- shurup
531+
- kirkonru
532+
teams: []
533+
enforce_admins: null
534+
required_linear_history: null

.github/workflows/auto-comment.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Auto Comment on Labeled PR
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- labeled
7+
- unlabeled
8+
9+
permissions:
10+
pull-requests: write
11+
12+
jobs:
13+
comment:
14+
runs-on: ubuntu-latest
15+
steps:
16+
# Checkout the repository code to the runner.
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
# Create a bin directory in the runner's home
21+
- name: Create bin directory
22+
run: |
23+
mkdir -p $HOME/bin
24+
echo "$HOME/bin" >> $GITHUB_PATH
25+
26+
# Install the latest jq and yq from GitHub releases
27+
- name: Install jq and yq
28+
run: |
29+
wget https://github.com/jqlang/jq/releases/latest/download/jq-linux-amd64 -O $HOME/bin/jq
30+
chmod +x $HOME/bin/jq
31+
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O $HOME/bin/yq
32+
chmod +x $HOME/bin/yq
33+
34+
# Main logic for adding comments based on labels.
35+
- name: Comment on PR based on external config
36+
run: |
37+
# Fetch the labels attached to the PR from the GitHub event JSON.
38+
pr_labels=$(jq -r '.pull_request.labels[] | .name' "$GITHUB_EVENT_PATH" | tr '\n' ' ')
39+
40+
# Define the path to the external YAML config file.
41+
config_file=".github/auto-comment-config.yaml"
42+
43+
# Get the number of label-comment mappings defined in the config file.
44+
num_mappings=$(yq e '.label_mappings | length' "$config_file")
45+
46+
# Loop through each label-comment mapping in the config file.
47+
for (( i=0; i<$num_mappings; i++ )); do
48+
# Fetch the labels and comment for the current mapping.
49+
mapfile -t labels < <(yq e ".label_mappings[$i].labels[]" "$config_file")
50+
comment=$(yq e ".label_mappings[$i].comment" "$config_file")
51+
52+
# Check if all required labels from the current mapping are present in the PR.
53+
for label in "${labels[@]}"; do
54+
if [[ ! $pr_labels == *"$label"* ]]; then
55+
echo "One or more required labels not found. Skipping."
56+
continue 2 # Skip to the next iteration of the outer loop.
57+
fi
58+
done
59+
60+
# Fetch the PR number from the GitHub event JSON.
61+
pr_number=$(jq -r '.pull_request.number' "$GITHUB_EVENT_PATH")
62+
63+
# If all required labels are found, add the comment to the PR.
64+
echo "All required labels found. Adding comment."
65+
gh pr comment "$pr_number" --body "$comment"
66+
67+
done
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
shell: bash

.github/workflows/check-outdated-content.yaml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ name: Check outdated content
44
on:
55
pull_request:
66
branches:
7-
- 'dev-ko' # add other branches or use wildcard 'dev-**'
7+
- 'dev-ko'
8+
- 'dev-es'
89
paths:
910
- 'content/en/**.md'
1011

1112
jobs:
1213
check-outdated-content:
1314
name: Check outdated content
1415

15-
# if: contains(fromJSON('["dev-ko", "dev-xx"]'), github.base_ref)
16+
if: contains(fromJSON('["dev-ko","dev-es"]'), github.base_ref)
1617
# Ref: https://docs.github.com/en/actions/learn-github-actions/expressions
1718

18-
if: github.base_ref == 'dev-ko'
19+
#if: github.base_ref == 'dev-ko'
1920

2021
# Condition to run this workflow on the upstream repository
2122
#if: github.repository == 'cncf/glossary'
@@ -38,21 +39,26 @@ jobs:
3839
# Set output direcory
3940
OUTPUT_DIR="./outdated"
4041
41-
# Set L10n directory and code
42+
# Set L10n code
43+
L10N_CODE="${L10N_BRANCH//dev-/}"
44+
echo "(DEBUG) L10N Code: ${L10N_CODE}"
45+
46+
# Set L10n directory
4247
case "${L10N_BRANCH}" in
43-
dev-ko)
44-
L10N_DIR="content/ko/"
45-
L10N_CODE="ko"
48+
dev-pt)
49+
L10N_DIR="content/pt-br/"
50+
;;
51+
dev-zh)
52+
L10N_DIR="content/zh-cn/"
53+
;;
54+
dev-tw)
55+
L10N_DIR="content/zh-tw/"
56+
;;
57+
*)
58+
L10N_DIR="content/${L10N_CODE}/"
4659
;;
47-
48-
#dev-pt)
49-
#L10N_DIR="content/pt-br/"
50-
#L10N_CODE="pt"
51-
#;;
5260
esac
53-
5461
echo "(DEBUG) L10N Directory: ${L10N_DIR}"
55-
echo "(DEBUG) L10N Code: ${L10N_CODE}"
5662
5763
# Set L10N_DIR, L10N_CODE, and OUTPUT_DIR as environment variables
5864
# Ref: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
@@ -61,7 +67,7 @@ jobs:
6167
echo "OUTPUT_DIR=${OUTPUT_DIR}" >> $GITHUB_ENV
6268
6369
- name: Checkout
64-
uses: actions/checkout@v3
70+
uses: actions/checkout@v4
6571
with:
6672
fetch-depth: 0 # fetch all history for all tags and branches
6773

@@ -89,12 +95,12 @@ jobs:
8995
# Get the lastest branch name from 'GITHUB_REF'
9096
# The latest branch can be 'upstream/main' or 'forked/dev-ko' (rebased)
9197
LATEST_BRANCH=${GITHUB_REF#refs/}
92-
echo "(DUBUG) LATEST_BRANCH: ${LATEST_BRANCH}"
98+
echo "(DEBUG) LATEST_BRANCH: ${LATEST_BRANCH}"
9399
94100
# Get the old branch from 'github.base_ref'
95101
# The old branch can be 'upstream/dev-ko'
96102
OLD_BRANCH="origin/${{github.base_ref}}"
97-
echo "(DUBUG) OLD_BRANCH: ${OLD_BRANCH}"
103+
echo "(DEBUG) OLD_BRANCH: ${OLD_BRANCH}"
98104
99105
L10N_INFO_JSON=$(cat <<EOF
100106
{
@@ -127,24 +133,24 @@ jobs:
127133
echo "(DEBUG) FILE_DIR: ${FILE_DIR}"
128134
echo "(DEBUG) FILE_NAME: ${FILE_NAME}"
129135
echo "(DEBUG) Localized file path: $L10N_FILE_PATH"
130-
echo "(DEBUG) Original file path: ./content/en/${FILE_PATH}"
136+
echo "(DEBUG) Original file path: content/en/${FILE_PATH}"
131137
132138
# Create subdirectories
133139
mkdir -p ${OUTPUT_DIR}/${FILE_DIR}
134140
135141
# Actually compare between the old and lastest English content and log diff in the file
136-
if [[ -f "./content/en/${FILE_PATH}" ]]; then
142+
if [[ -f "content/en/${FILE_PATH}" ]]; then
137143
# File exists
138144
# Check changes
139-
git diff ${OLD_BRANCH}..${LATEST_BRANCH} -- ./content/en/${FILE_PATH} > temp.diff
145+
git diff ${OLD_BRANCH}..${LATEST_BRANCH} -- content/en/${FILE_PATH} > temp.diff
140146
141147
if [[ -s "temp.diff" ]]; then
142148
echo "(DEBUG) ${FILE_PATH} is outdated."
143149
mv temp.diff ${OUTPUT_DIR}/${FILE_PATH}
144150
fi
145151
146152
else
147-
echo "(DEBUG) ${FILE_PATH} dose not exist."
153+
echo "(DEBUG) ${FILE_PATH} does not exist."
148154
# File dose not exist (e.g, changed, renamed or removed)
149155
echo "Could not find ${FILE_PATH} in content/en/" > ${OUTPUT_DIR}/${FILE_PATH}
150156
echo "Need to check if it has been changed, renamed or removed" >> ${OUTPUT_DIR}/${FILE_PATH}
@@ -167,4 +173,4 @@ jobs:
167173
# content-filepath: ${{ steps.checker.outputs.output_path }}
168174
# labels: |
169175
# outdated
170-
# lang/ko
176+
# lang/ko

.github/workflows/es-spellcheck.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
name: Run PySpelling tool to verify spanish spelling issues
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
- name: Check word list sort
2828
run: |
2929
set -o errexit
3030
diff content/es/.wordlist.txt <(LC_ALL= sort -f content/es/.wordlist.txt)
3131
- name: GitHub Spellcheck Action
32-
uses: rojopolis/spellcheck-github-actions@0.33.1
32+
uses: rojopolis/spellcheck-github-actions@0.34.0
3333
with:
3434
config_path: content/es/.spellcheck.yml

.github/workflows/spellcheck.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
# Steps represent a sequence of tasks that will be executed as part of the job
2323
steps:
2424
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2626

2727
- name: GitHub Spellcheck Action
28-
uses: rojopolis/spellcheck-github-actions@0.33.1
28+
uses: rojopolis/spellcheck-github-actions@0.34.0

0 commit comments

Comments
 (0)