Skip to content

Commit de74f96

Browse files
feat: Add translation check workflow for pull requests (#1689)
* Introduced a new GitHub Actions workflow to check for changes in translation files & a new workflow for labeling based upon the changed files on pull requests. * The workflow detects changes in JSON files located in the src/lang directory and runs a lint check if any changes are found. * Added a Workflow to label Pull requests based on their changed files.
1 parent bdf10da commit de74f96

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

.github/labeler.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
translations:
2+
- any:
3+
- changed-files:
4+
- any-glob-to-any-file: 'src/lang/*.json'
5+
6+
docs:
7+
- any:
8+
- changed-files:
9+
- any-glob-to-any-file: '**/*.md'
10+
11+
enhancement:
12+
- any:
13+
- head-branch: ['^feature', 'feature', '^feat', '^add']
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Add Pull Requests Labels
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
6+
jobs:
7+
add-labels:
8+
timeout-minutes: 5
9+
runs-on: ubuntu-latest
10+
11+
if: github.event.action == 'opened'
12+
permissions:
13+
contents: read
14+
pull-requests: write
15+
16+
steps:
17+
- uses: actions/labeler@v6

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,34 @@ jobs:
3333

3434
- name: Run Biome
3535
run: biome ci .
36+
37+
translation-check:
38+
name: Translation Check (On PR Only)
39+
timeout-minutes: 5
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: read
43+
pull-requests: read
44+
if: github.event_name == 'pull_request'
45+
steps:
46+
- name: Checkout Repository
47+
uses: actions/checkout@v5
48+
- name: Use Node.js
49+
uses: actions/setup-node@v5
50+
with:
51+
cache: npm
52+
cache-dependency-path: '**/package-lock.json'
53+
54+
- name: Detect Changed Files
55+
uses: dorny/paths-filter@v3
56+
id: file-changes
57+
with:
58+
list-files: shell
59+
filters: |
60+
translation:
61+
- 'src/lang/*.json'
62+
token: ${{ secrets.GITHUB_TOKEN }}
63+
- name: Translation Files Check (if changed)
64+
if: steps.file-changes.outputs.translation == 'true'
65+
run: |
66+
npm run lint check

0 commit comments

Comments
 (0)