2021-01-15 13:28:01 +00:00
name : No translate on GitHub
2021-01-13 17:30:52 +00:00
on :
pull_request_target :
branches :
2021-02-18 16:04:03 +00:00
- 'main'
2021-01-13 17:30:52 +00:00
paths :
- 'curriculum/challenges/**'
- '!curriculum/challenges/english/**'
2021-02-24 19:28:16 +00:00
- 'client/i18n/locales/**/intro.json'
- 'client/i18n/locales/**/translations.json'
- '!client/i18n/locales/english/**'
2021-03-04 16:00:51 +00:00
- 'docs/i18n/**'
2021-01-13 17:30:52 +00:00
jobs :
has-translation :
runs-on : ubuntu-latest
steps :
- uses : actions/github-script@v3
with :
github-token : ${{secrets.GITHUB_TOKEN}}
script : |
2021-03-05 03:56:42 +00:00
if (context.payload.pull_request.user.login !== "camperbot") {
2021-02-21 15:24:38 +00:00
core.setFailed('This PR appears to touch translated curriculum files.')
github.issues.createComment({
2021-02-18 16:04:03 +00:00
issue_number : context.issue.number,
owner : context.repo.owner,
repo : context.repo.repo,
2021-02-24 19:28:16 +00:00
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."
2021-02-18 16:04:03 +00:00
})
} else {
2021-02-21 15:24:38 +00:00
github.issues.createComment({
2021-02-18 16:04:03 +00:00
issue_number : context.issue.number,
owner : context.repo.owner,
repo : context.repo.repo,
2021-03-05 03:56:42 +00:00
body : 'WAIT! This message serves as a sanity check. You should *only* see this message if the PR was created as part of a Crowdin download action.'
2021-02-18 16:04:03 +00:00
})
}