Skip to content

Add express-joi-validations to community middlewares #2

Add express-joi-validations to community middlewares

Add express-joi-validations to community middlewares #2

Workflow file for this run

name: Check Translation
on:
pull_request:
branches:
- gh-pages
paths:
- 'en/**'
- 'es/**'
- 'fr/**'
- 'it/**'
- 'ja/**'
- 'ko/**'
- 'pt-br/**'
- 'ru/**'
- 'sk/**'
- 'th/**'
- 'tr/**'
- 'uk/**'
- 'uz/**'
- 'zh-cn/**'
- 'zh-tw/**'
workflow_dispatch:
inputs:
prNumber:
description: 'PR number to check'
required: true
jobs:
check-translation:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check modified files and add labels
uses: actions/github-script@v5
with:
script: |
const languages = ['en', 'es', 'fr', 'it', 'ja', 'ko', 'pt-br', 'ru', 'sk', 'th', 'tr', 'uk', 'uz', 'zh-cn', 'zh-tw'];
const prNumber = context.eventName === 'workflow_dispatch' ? context.payload.inputs.prNumber : context.issue.number;
const { data: pullRequest } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});
const { data: files } = await github.rest.pulls.listFiles({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});
const modifiedLanguages = new Set(files.map(file => file.filename.split('/')[0]));
const labelsToAdd = languages.filter(lang => !modifiedLanguages.has(lang)).map(lang => `requires-translation-${lang}`);
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequest.number,
labels: labelsToAdd
});