Skip to content

Commit ed8bd26

Browse files
committed
chore(ci): fix translate workflow
Signed-off-by: Swilder-M <i@codming.com>
1 parent 8222af1 commit ed8bd26

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/translate_to_ja.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- release-5.10
88
paths:
99
- 'en_US/**'
10+
workflow_dispatch:
1011

1112
concurrency:
1213
group: translate-ja-${{ github.ref }}
@@ -21,6 +22,17 @@ jobs:
2122
pull-requests: write
2223
if: github.repository_owner == 'emqx'
2324
steps:
25+
- name: Check branch for manual runs
26+
if: github.event_name == 'workflow_dispatch'
27+
run: |
28+
current_branch="${GITHUB_REF#refs/heads/}"
29+
if [[ "$current_branch" != "release-5.9" && "$current_branch" != "release-5.10" ]]; then
30+
echo "Error: Manual runs are only allowed on release-5.9 or release-5.10 branches"
31+
echo "Current branch: $current_branch"
32+
exit 1
33+
fi
34+
echo "Manual run approved on branch: $current_branch"
35+
2436
- name: Generate GitHub App token
2537
id: app-token
2638
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
@@ -110,7 +122,7 @@ jobs:
110122
python3 .github/scripts/translate_to_ja.py "$file"
111123
fi
112124
done < modified_files.txt
113-
python3 .github/scripts/translate_to_ja.py dir.yaml
125+
python3 .github/scripts/translate_to_ja.py ./dir.yaml
114126
115127
- name: Update last translation commit hash
116128
if: steps.modified-files.outputs.has_changes == 'true'

0 commit comments

Comments
 (0)