Skip to content

Commit c896ce5

Browse files
committed
translate for English
1 parent b8166cf commit c896ce5

File tree

4 files changed

+132
-125
lines changed

4 files changed

+132
-125
lines changed
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
# !/bin/bash (実行権限を付与せずbashコマンドで実行されるため実際には使用されない)
2-
# 厳格モードを設定
1+
# !/bin/bash (This is not used as the script is executed with bash command without execution permission)
2+
# Set strict mode
33
set -eu
44

5-
# DRY_RUNがtrueでない場合のみ実行
5+
# Only execute if DRY_RUN is not true
66
if [[ "$DRY_RUN" != "true" ]]; then
7-
echo "::group::PR作成完了"
8-
echo "MySQLシェルバージョン更新のPRが作成されました。"
7+
echo "::group::PR Creation Completed"
8+
echo "PR for MySQL Shell version update has been created."
99
echo ""
10-
echo "ワークフローファイルは自動的に更新されましたが、念のため確認してください。"
11-
echo "万一、自動更新が失敗した場合は、以下の手順で手動更新が可能です:"
10+
echo "Workflow files have been automatically updated, but please verify them."
11+
echo "If automatic updates failed, you can update manually using the following steps:"
1212
echo ""
1313
echo "::endgroup::"
1414

15-
echo "::group::ワークフローファイル更新手順(バックアップ)"
16-
echo "1. PRブランチをローカルにチェックアウト:"
15+
echo "::group::Workflow File Update Procedure (Backup)"
16+
echo "1. Checkout the PR branch locally:"
1717
echo " git fetch origin $BRANCH_NAME && git checkout $BRANCH_NAME"
1818
echo ""
19-
echo "2. 以下のコマンドでワークフローファイルを更新:"
19+
echo "2. Update workflow files with the following commands:"
2020

21-
# Innovation更新の場合
21+
# For Innovation update
2222
if [[ "$INNOVATION_UPDATE_NEEDED" == "true" ]]; then
2323
INNOVATION_MAJOR=$(echo "$LATEST_INNOVATION" | cut -d. -f1)
2424
INNOVATION_MINOR=$(echo "$LATEST_INNOVATION" | cut -d. -f2)
2525
INNOVATION_SHORT="${INNOVATION_MAJOR}.${INNOVATION_MINOR}"
26-
echo " # Innovation更新コマンド:"
26+
echo " # Innovation update command:"
2727
echo " find .github/workflows -name \"docker-*.yml\" -exec sed -i 's/version: ${INNOVATION_MAJOR}\\.x/version: ${INNOVATION_SHORT}/g' {} \\;"
2828
fi
2929

30-
# LTS更新の場合
30+
# For LTS update
3131
if [[ "$LTS_UPDATE_NEEDED" == "true" ]]; then
3232
LTS_MAJOR=$(echo "$LATEST_LTS" | cut -d. -f1)
3333
LTS_MINOR=$(echo "$LATEST_LTS" | cut -d. -f2)
3434
LTS_SHORT="${LTS_MAJOR}.${LTS_MINOR}"
35-
echo " # LTS更新コマンド:"
35+
echo " # LTS update command:"
3636
echo " find .github/workflows -name \"docker-*.yml\" -exec sed -i 's/version: ${LTS_MAJOR}\\.x/version: ${LTS_SHORT}/g' {} \\;"
3737
fi
3838

3939
echo ""
40-
echo "3. 変更をコミット:"
40+
echo "3. Commit the changes:"
4141
echo " git add .github/workflows/"
4242
echo " git commit -m \"Update workflow files for MySQL Shell versions\""
4343
echo ""
44-
echo "4. 変更をプッシュ:"
44+
echo "4. Push the changes:"
4545
echo " git push origin $BRANCH_NAME"
4646
echo ""
47-
echo "これで既存のPRにワークフロー更新が追加されます。"
47+
echo "This will add workflow file updates to the existing PR."
4848
echo "::endgroup::"
4949
fi
Lines changed: 74 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
# !/bin/bash (実行権限を付与せずbashコマンドで実行されるため実際には使用されない)
2-
# 厳格モードを設定
1+
# !/bin/bash (This is not used as the script is executed with bash command without execution permission)
2+
# Set strict mode
33
set -eu
44

5-
# dry runモードを確認
5+
# Check if in dry run mode
66
if [[ "$DRY_RUN" == "true" ]]; then
7-
echo "::notice::dry runモードで実行しています。実際の変更は行いません。"
7+
echo "::notice::Running in dry run mode. No actual changes will be made."
88
fi
99

10-
# ブランチ作成
11-
BRANCH_NAME="bot/update-mysql-shell-$(date +%Y%m%d%H%M%S)"
10+
# Use the BRANCH_NAME environment variable passed from the workflow
11+
# Verify that BRANCH_NAME is set
12+
if [[ -z "${BRANCH_NAME:-}" ]]; then
13+
echo "::error::BRANCH_NAME environment variable is not set. This should be set by the workflow."
14+
exit 1
15+
fi
16+
17+
echo "Using branch name: $BRANCH_NAME"
18+
1219
if [[ "$DRY_RUN" != "true" ]]; then
1320
git config --global user.name 'github-actions[bot]'
1421
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
@@ -17,11 +24,11 @@ else
1724
echo "dry run: git checkout -b $BRANCH_NAME"
1825
fi
1926

20-
# PR本文の初期化
27+
# Initialize PR body
2128
PR_TEMPLATE=$(cat .github/check-new-release/templates/pr.md)
2229
PR_BODY=""
2330

24-
# バージョン更新関数
31+
# Version update function
2532
update_version() {
2633
local type=$1
2734
local current_version=$2
@@ -32,52 +39,52 @@ update_version() {
3239

3340
echo "Updating $type to $new_version (major.minor: $short_version)..."
3441

35-
# Dockerfile の更新
42+
# Update Dockerfile
3643
if [[ "$DRY_RUN" != "true" ]]; then
3744
if ! sed -i "s/^ARG MYSQL_SHELL_VERSION=.*/ARG MYSQL_SHELL_VERSION=$new_version/" docker/$type/Dockerfile; then
3845
echo "::error::Failed to update version in docker/$type/Dockerfile"
39-
echo "このエラーは重要なファイル更新に失敗したため、処理を中断します。"
46+
echo "This is a critical error while updating an important file. Aborting."
4047
exit 1
4148
fi
4249

43-
# 更新が成功したか検証
50+
# Verify the update was successful
4451
if ! grep -q "ARG MYSQL_SHELL_VERSION=$new_version" docker/$type/Dockerfile; then
4552
echo "::error::Version update in docker/$type/Dockerfile could not be verified"
46-
echo "Dockerfileの更新内容を確認できないため処理を中断します。"
53+
echo "Cannot verify Dockerfile update. Aborting."
4754
exit 1
4855
fi
4956
else
50-
# dry runモードではより詳細な情報を表示
51-
echo "dry run: 実行予定のコマンド: sed -i \"s/^ARG MYSQL_SHELL_VERSION=.*/ARG MYSQL_SHELL_VERSION=$new_version/\" docker/$type/Dockerfile"
52-
echo "dry run: docker/$type/Dockerfile 内の ARG MYSQL_SHELL_VERSION=$current_version $new_version に更新"
57+
# Show more detailed information in dry run mode
58+
echo "dry run: Command to execute: sed -i \"s/^ARG MYSQL_SHELL_VERSION=.*/ARG MYSQL_SHELL_VERSION=$new_version/\" docker/$type/Dockerfile"
59+
echo "dry run: Update ARG MYSQL_SHELL_VERSION=$current_version to $new_version in docker/$type/Dockerfile"
5360
fi
5461

55-
# README.md の更新
62+
# Update README.md
5663
if [[ "$type" == "innovation" ]]; then
5764
local match_pattern="Innovation Series ([0-9]\\.[0-9]\\.[x0-9])"
5865
local replace_value="Innovation Series (${major_version}.${minor_version}.x)"
5966
local tag_pattern="snickerjp\/docker-mysql-shell:${major_version}\\.[0-9]"
6067
local tag_replace="snickerjp\/docker-mysql-shell:${short_version}"
6168

6269
if [[ "$DRY_RUN" != "true" ]]; then
63-
# READMEの更新は重要だが失敗しても処理は継続する
70+
# README updates are important but we continue even if they fail
6471
sed -i "s/$match_pattern/$replace_value/g" README.md
6572
if [ $? -ne 0 ]; then
6673
echo "::warning::Failed to update Innovation Series version in README.md"
67-
echo "README.mdの更新に失敗しましたが、処理は継続します。"
74+
echo "Failed to update README.md but will continue with the process."
6875
fi
6976

7077
sed -i "s/$tag_pattern/$tag_replace/g" README.md
7178
if [ $? -ne 0 ]; then
7279
echo "::warning::Failed to update Innovation image tag in README.md"
73-
echo "README.mdのタグ更新に失敗しましたが、処理は継続します。"
80+
echo "Failed to update tag in README.md but will continue with the process."
7481
fi
7582
else
76-
# dry runモードではより詳細な情報を表示
77-
echo "dry run: 実行予定のコマンド: sed -i \"s/$match_pattern/$replace_value/g\" README.md"
78-
echo "dry run: 実行予定のコマンド: sed -i \"s/$tag_pattern/$tag_replace/g\" README.md"
79-
echo "dry run: README.md 内の '$match_pattern' '$replace_value' に更新"
80-
echo "dry run: README.md 内の '$tag_pattern' '$tag_replace' に更新"
83+
# Show more detailed information in dry run mode
84+
echo "dry run: Command to execute: sed -i \"s/$match_pattern/$replace_value/g\" README.md"
85+
echo "dry run: Command to execute: sed -i \"s/$tag_pattern/$tag_replace/g\" README.md"
86+
echo "dry run: Update '$match_pattern' to '$replace_value' in README.md"
87+
echo "dry run: Update '$tag_pattern' to '$tag_replace' in README.md"
8188
fi
8289
else
8390
local match_pattern="LTS Series ([0-9]\\.[0-9]\\.[x0-9])"
@@ -89,118 +96,118 @@ update_version() {
8996
sed -i "s/$match_pattern/$replace_value/g" README.md
9097
if [ $? -ne 0 ]; then
9198
echo "::warning::Failed to update LTS Series version in README.md"
92-
echo "README.mdの更新に失敗しましたが、処理は継続します。"
99+
echo "Failed to update README.md but will continue with the process."
93100
fi
94101

95102
sed -i "s/$tag_pattern/$tag_replace/g" README.md
96103
if [ $? -ne 0 ]; then
97104
echo "::warning::Failed to update LTS image tag in README.md"
98-
echo "README.mdのタグ更新に失敗しましたが、処理は継続します。"
105+
echo "Failed to update tag in README.md but will continue with the process."
99106
fi
100107
else
101-
# dry runモードではより詳細な情報を表示
102-
echo "dry run: 実行予定のコマンド: sed -i \"s/$match_pattern/$replace_value/g\" README.md"
103-
echo "dry run: 実行予定のコマンド: sed -i \"s/$tag_pattern/$tag_replace/g\" README.md"
104-
echo "dry run: README.md 内の '$match_pattern' '$replace_value' に更新"
105-
echo "dry run: README.md 内の '$tag_pattern' '$tag_replace' に更新"
108+
# Show more detailed information in dry run mode
109+
echo "dry run: Command to execute: sed -i \"s/$match_pattern/$replace_value/g\" README.md"
110+
echo "dry run: Command to execute: sed -i \"s/$tag_pattern/$tag_replace/g\" README.md"
111+
echo "dry run: Update '$match_pattern' to '$replace_value' in README.md"
112+
echo "dry run: Update '$tag_pattern' to '$tag_replace' in README.md"
106113
fi
107114
fi
108115

109-
# ワークフローファイルの自動更新
116+
# Automatically update workflow files
110117
local workflow_files=$(find .github/workflows -name "docker-*.yml" 2>/dev/null || echo "")
111118
if [[ -n "$workflow_files" ]]; then
112-
echo "ワークフローファイルを自動的に更新します..."
119+
echo "Automatically updating workflow files..."
113120

114121
local version_pattern="version: ${major_version}\\.x"
115122
local version_replace="version: ${short_version}"
116123

117124
if [[ "$DRY_RUN" != "true" ]]; then
118-
# 各ファイルに対して実行
125+
# Execute for each file
119126
for workflow_file in $workflow_files; do
120127
if grep -q "$version_pattern" "$workflow_file"; then
121-
echo "更新: $workflow_file"
128+
echo "Updating: $workflow_file"
122129
sed -i "s/$version_pattern/$version_replace/g" "$workflow_file"
123130
if [ $? -ne 0 ]; then
124131
echo "::warning::Failed to update version in $workflow_file"
125-
echo "ワークフローファイル $workflow_file の更新に失敗しましたが、処理は継続します。"
132+
echo "Failed to update workflow file $workflow_file but will continue with the process."
126133
fi
127134
else
128-
echo "::info::該当するパターンがないため更新不要: $workflow_file"
135+
echo "::info::No matching pattern found, no update needed: $workflow_file"
129136
fi
130137
done
131138
else
132-
echo "dry run: 以下のファイルを更新予定:"
139+
echo "dry run: Files to be updated:"
133140
for workflow_file in $workflow_files; do
134141
if grep -q "$version_pattern" "$workflow_file"; then
135-
echo "dry run: $workflow_file 内の '$version_pattern' '$version_replace' に更新"
136-
echo "dry run: 実行予定のコマンド: sed -i \"s/$version_pattern/$version_replace/g\" \"$workflow_file\""
142+
echo "dry run: Update '$version_pattern' to '$version_replace' in $workflow_file"
143+
echo "dry run: Command to execute: sed -i \"s/$version_pattern/$version_replace/g\" \"$workflow_file\""
137144
fi
138145
done
139146
fi
140147

141-
# PR説明文にワークフローファイル更新の旨を追加
142-
PR_BODY="${PR_BODY} (ワークフローファイルも自動的に更新されました)"
148+
# Add workflow file update note to PR description
149+
PR_BODY="${PR_BODY} (Workflow files were automatically updated)"
143150
else
144-
echo "::warning::ワークフローファイルが見つかりませんでした。"
151+
echo "::warning::No workflow files found."
145152
fi
146153

147-
# PR本文に変更内容を追加(整形された形式で)
154+
# Add version update details to PR body (formatted)
148155
PR_BODY="${PR_BODY}
149156
150-
### ${type^} バージョン更新
157+
### ${type^} Version Update
151158
* **${current_version}** → **${new_version}**"
152159

153-
# 成功ログ
154-
echo "$type のバージョン更新が完了しました"
160+
# Success log
161+
echo "$type version update completed"
155162
}
156163

157-
# Innovation の更新
164+
# Update Innovation
158165
if [[ "$INNOVATION_UPDATE_NEEDED" == "true" ]]; then
159166
update_version "innovation" "$CURRENT_INNOVATION" "$LATEST_INNOVATION"
160167
fi
161168

162-
# LTS の更新
169+
# Update LTS
163170
if [[ "$LTS_UPDATE_NEEDED" == "true" ]]; then
164171
update_version "lts" "$CURRENT_LTS" "$LATEST_LTS"
165172
fi
166173

167-
# PR本文に必要な手順を追加
174+
# Add necessary steps to PR body
168175
PR_BODY="${PR_BODY}
169176
170-
## 更新内容
171-
- Dockerfileのバージョン番号更新
172-
- README.mdのバージョン表記を更新
173-
- ワークフローファイルを自動的に更新
177+
## Update Content
178+
- Updated version numbers in Dockerfiles
179+
- Updated version references in README.md
180+
- Automatically updated workflow files
174181
175-
## ⚠️ 注意事項
176-
1. ワークフローファイルの自動更新が行われていない場合は手動で更新してください
177-
2. マージ前に各ファイルの更新内容を確認してください"
182+
## ⚠️ Notes
183+
1. If workflow files were not automatically updated, please update them manually
184+
2. Please verify all file changes before merging"
178185

179-
# 変更をコミットしてプッシュ
186+
# Commit and push changes
180187
changed_files=$(git status --porcelain | awk '{print $2}')
181188
if [[ -z "$changed_files" ]]; then
182189
echo "No changes to commit."
183190
exit 0
184191
fi
185192

186-
# ファイルの変更をチェック
193+
# Check changed files
187194
echo "Changed files:"
188195
for file in $changed_files; do
189196
echo "- $file"
190197
done
191198

192-
# すべての変更をステージング
199+
# Stage all changes
193200
if [[ "$DRY_RUN" != "true" ]]; then
194201
git add $changed_files
195202
git commit -m "Update MySQL Shell versions (Innovation: $LATEST_INNOVATION, LTS: $LATEST_LTS)"
196203

197-
# エラーハンドリング付きでプッシュ
204+
# Push with error handling
198205
if ! git push origin $BRANCH_NAME; then
199206
echo "::error::Failed to push changes to GitHub"
200207
exit 1
201208
fi
202209

203-
# プルリクエストを作成
210+
# Create pull request
204211
if ! gh pr create \
205212
--base develop \
206213
--head $BRANCH_NAME \
@@ -212,13 +219,13 @@ if [[ "$DRY_RUN" != "true" ]]; then
212219

213220
echo "Pull request created successfully!"
214221
else
215-
echo "dry run: 以下のファイルが変更されます:"
222+
echo "dry run: The following files would be changed:"
216223
for file in $changed_files; do
217224
echo "- $file"
218225
done
219-
echo "dry run: コミットメッセージ: Update MySQL Shell versions (Innovation: $LATEST_INNOVATION, LTS: $LATEST_LTS)"
220-
echo "dry run: PR作成: タイトル: Update MySQL Shell versions (Innovation: $LATEST_INNOVATION, LTS: $LATEST_LTS)"
221-
echo "dry run: PR本文:"
226+
echo "dry run: Commit message: Update MySQL Shell versions (Innovation: $LATEST_INNOVATION, LTS: $LATEST_LTS)"
227+
echo "dry run: PR creation: Title: Update MySQL Shell versions (Innovation: $LATEST_INNOVATION, LTS: $LATEST_LTS)"
228+
echo "dry run: PR body:"
222229
echo -e "$PR_BODY"
223-
echo "dry run終了: 実際の変更は行われていません。"
230+
echo "dry run completed: No actual changes were made."
224231
fi
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
Automated update for MySQL Shell versions.
22

3-
## 更新内容
3+
## Updates
44

5-
### {{TYPE}} バージョン更新
5+
### {{TYPE}} Version Update
66
* **{{CURRENT_VERSION}}****{{NEW_VERSION}}**
77

8-
## 更新済みファイル
9-
- Dockerfileのバージョン番号更新
10-
- README.mdのバージョン表記を更新
11-
- ワークフローファイルの自動更新
8+
## Updated Files
9+
- Version numbers in Dockerfiles
10+
- Version references in README.md
11+
- Automatic workflow file updates
1212

13-
## ⚠️ 注意事項
14-
1. ワークフローファイルの自動更新が行われていない場合は手動で更新してください
15-
2. マージ前に各ファイルの更新内容を確認してください
13+
## ⚠️ Notes
14+
1. If workflow files were not automatically updated, please update them manually
15+
2. Please verify all file changes before merging

0 commit comments

Comments
 (0)