From 94190f51fcd9f915b56f58b3fae4ec0a5fcc3db3 Mon Sep 17 00:00:00 2001 From: "Nicholas Carrigan (he/him)" Date: Wed, 13 Jan 2021 09:30:52 -0800 Subject: [PATCH] feat(tools): add action to check for translations (#40692) Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> --- .github/workflows/no-prs-to-translation.yml | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/no-prs-to-translation.yml diff --git a/.github/workflows/no-prs-to-translation.yml b/.github/workflows/no-prs-to-translation.yml new file mode 100644 index 0000000000..be7cf957aa --- /dev/null +++ b/.github/workflows/no-prs-to-translation.yml @@ -0,0 +1,25 @@ +name: 'No changing translated files on GitHub' +on: + pull_request_target: + branches: + - 'master' + paths: + - 'curriculum/challenges/**' + - '!curriculum/challenges/english/**' + +jobs: + has-translation: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v3 + if: github.event.pull_request.user.login != "github-actions[bot]" + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + await github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'You appear to be adding/modifying/deleting non-English curriculum files directly on GitHub. If you are trying to make translation changes to a curriculum challenge file, please visit https://translate.freecodecamp.org/curriculum instead.' + }) + throw "You appear to be translating files directly on GitHub. Please visit https://translate.freecodecamp.org instead."