freeCodeCamp/.github/workflows/no-prs-to-translation.yml

35 lines
1.5 KiB
YAML
Raw Normal View History

name: No translate on GitHub
on:
pull_request_target:
branches:
- 'main'
paths:
- 'curriculum/challenges/**'
- '!curriculum/challenges/english/**'
jobs:
has-translation:
runs-on: ubuntu-latest
if: github.actor != 'github-actions[bot]'
steps:
- uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
if (context.payload.pull_request.head.repo.fork) {
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 curriculum-related changes to non-English files. Please visit [our contributing guidelines](https://contribute.freecodecamp.org) to learn more about translating freeCodeCamp's resources.'
})
core.setFailed('This PR appears to touch translated challenge files.')
} 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. Before merging, please confirm that the commits on this PR originated from the Crowdin download action.'
})
}