-
Notifications
You must be signed in to change notification settings - Fork 8
52 lines (46 loc) · 1.76 KB
/
pullrequest.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
46
47
48
49
50
51
52
name: check pull requests
on:
pull_request:
jobs:
check:
name: 🔍 Check pull request
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'reviewed/skip-check') }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: check translations
uses: dorny/paths-filter@v2
id: changes
with:
list-files: json
filters: |
translations:
- "src/i18n/locales/!(en)/*.json"
- "src/i18n/locales/locales.json"
- name: format files output
if: steps.changes.outputs.translations == 'true'
id: files-output
run: |
files=$(node -e 'console.log("- " + JSON.parse(`${{ steps.changes.outputs.translations_files }}`).join("\n- "))')
files="${files//$'\n'/'%0A'}"
echo "::set-output name=files::${files}"
- name: comment on pull request
if: steps.changes.outputs.translations == 'true'
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.VOCASCAN_BOT_TOKEN }}
with:
msg: |
Thank you for your pull request.
Please remove your translations. Change only the `en/default.json` if necessary.
If this pull request is merged into the [`experimental`](https://github.com/vocascan/vocascan-frontend/tree/experimental) branch, it can be translated via [localazy](https://localazy.com/p/vocascan).
Please remove following files from pull request changes.
```
${{ steps.files-output.outputs.files }}
```
- name: check if failed
if: steps.changes.outputs.translations == 'true'
run: |
echo "only change en.json"
exit 1