38 lines
1.7 KiB
YAML
38 lines
1.7 KiB
YAML
name: No translate on GitHub
|
|
on:
|
|
pull_request_target:
|
|
branches:
|
|
- 'main'
|
|
paths:
|
|
- 'curriculum/challenges/**'
|
|
- '!curriculum/challenges/english/**'
|
|
- 'client/i18n/locales/**/intro.json'
|
|
- 'client/i18n/locales/**/translations.json'
|
|
- '!client/i18n/locales/english/**'
|
|
- 'docs/i18n/**'
|
|
|
|
jobs:
|
|
has-translation:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/github-script@v3
|
|
with:
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
script: |
|
|
if (context.payload.pull_request.head.repo.fork) {
|
|
core.setFailed('This PR appears to touch translated curriculum files.')
|
|
github.issues.createComment({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
body: "Thanks for your pull-request. We are no longer accepting changes to the non-English versions of files in parts of this codebase. This pull-request seems to change some of those. Please visit [our contributing guidelines](https://contribute.freecodecamp.org) to learn more about translating freeCodeCamp's resources."
|
|
})
|
|
} else {
|
|
github.issues.createComment({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
body: 'WAIT! This message serves as a sanity check. Your PR appears to come from the base freeCodeCamp repository and modifies translated curriculum files or intro.json or translations.json. Before merging, please confirm that the commits on this PR originated from the Crowdin download action.'
|
|
})
|
|
}
|