-
Notifications
You must be signed in to change notification settings - Fork 549
45 lines (37 loc) · 1.17 KB
/
locale-pull-request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Check Locale PR
on:
pull_request:
paths:
- 'locale/**'
jobs:
check-locale-pr:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Enforce base branch
uses: actions/github-script@v7
with:
script: |
// Get the pull request
const pull_request = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number
});
// Check if the base branch is 'main' or 'master'
if (pull_request.data.base.ref === 'main' || pull_request.data.base.ref === 'master') {
console.error('Pull request is targeting the main branch. Please target the develop branch instead.');
process.exit(1);
}
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Run locale:check
id: locale-check
run: npm run locale:check