fix(tools): only camperbot translates (#41366)

* fix(tools): only camperbot translates

Modifies the no pr to translation workflow to fail on any PR that
was not created by camperbot.

* fix(tools): update message

* Update .github/workflows/no-prs-to-translation.yml

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
This commit is contained in:
Nicholas Carrigan (he/him)
2021-03-04 19:56:42 -08:00
committed by GitHub
parent 4fe3828537
commit 269209e7c3

View File

@ -19,7 +19,7 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
if (context.payload.pull_request.head.repo.fork) {
if (context.payload.pull_request.user.login !== "camperbot") {
core.setFailed('This PR appears to touch translated curriculum files.')
github.issues.createComment({
issue_number: context.issue.number,
@ -32,6 +32,6 @@ jobs:
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.'
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.'
})
}