Translate the latest msgs #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Locale PR | |
on: | |
pull_request: | |
paths: | |
- 'locale/**' | |
jobs: | |
check-locale-pr: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm ci | |
- name: Label PR and enforce base branch | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
// console.warn('This is bugged and doesn\'t work, skip this step for now!'); | |
// process.exit(0); | |
// Add the 'translation' label | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['translation'] | |
}); | |
console.log(JSON.stringify(context.payload.pull_request)); | |
const { repo, owner } = context.repo; | |
// Get the pull request | |
const pull_number = context.payload.pull_request.number; | |
const pull_request = await github.rest.pulls.get({ | |
owner, | |
repo, | |
pull_number | |
}); | |
// Check if the base branch is 'main' or 'master' | |
if (pull_request.data.base.ref === 'main' || pull_request.data.base.ref === 'master') { | |
// Change the base branch to 'develop' | |
await github.rest.pulls.update({ | |
owner, | |
repo, | |
pull_number, | |
base: 'develop' | |
}); | |
} | |
- name: Run locale:check | |
id: locale-check | |
run: npm run locale:check |