Update sv.json #14
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 | |
uses: actions/[email protected] | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm ci | |
- name: Label PR and enforce base branch | |
uses: actions/[email protected] | |
with: | |
script: | | |
console.warn('This is bugged and doesn't work, skip this step for now!'); | |
process.exit(0); | |
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 | |
}); | |
// Add the 'translation' label | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['translation'] | |
}) | |
// 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' | |
}); | |
} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run locale:check | |
id: locale-check | |
run: npm run locale:check |