[pull] main from freeCodeCamp:main #1450
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: GitHub - No translations via PRs | |
on: | |
pull_request_target: | |
branches: | |
- 'main' | |
paths: | |
- 'curriculum/challenges/**/*.md' | |
- '!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-22.04 | |
steps: | |
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6 | |
with: | |
github-token: ${{secrets.CAMPERBOT_NO_TRANSLATE}} | |
script: | | |
const isDev = await github.rest.teams.getMembershipForUserInOrg({ | |
org: "freeCodeCamp", | |
team_slug: "dev-team", | |
username: context.payload.pull_request.user.login | |
}).catch(() => ({status: 404})); | |
if (context.payload.pull_request.user.login !== "camperbot" && isDev.status !== 200) { | |
core.setFailed('This PR appears to touch translated curriculum files.') | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: "Thanks for your pull request.\n\n**Please remove the changes made to the non-English versions of the files. No need to close this pull request; just add more commits as needed.**\n\nWe require you to change **only English** versions of files in the codebase. Translations to corresponding files in other world languages are managed on our translation platform. Once your pull request is merged, changes will be synced automatically to other world languages.\n\nPlease visit [our contributing guidelines](https://contribute.freecodecamp.org) to learn more about translating freeCodeCamp's resources.\n\nAs always, we value all of your contributions.\n\nHappy contributing!\n\n---\n_**Note:** This message was automatically generated by a bot. If you feel this message is in error or would like help resolving it, feel free to reach us [in our contributor chat](https://discord.gg/PRyKn3Vbay)._" | |
}) | |
} else if (isDev.status === 200) { | |
core.setFailed('This PR appears to touch translated curriculum files, but since you are on the dev team there is no message.'); | |
} |