Skip to content

repo sync #3380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions .github/workflows/triage-unallowed-contributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,23 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const changedFiles = ${{steps.filter.outputs.notAllowed_files}}
const restFiles = ${{steps.filter.outputs.openapi_files}}
const translationFiles = ${{steps.filter.outputs.translation_files}}
const markdownFiles = changedFiles.map(file => `- \`${file}\`\n`).join('')
constFilesArr = [
'translations/**',
'lib/rest/static/**',
'.github/workflows/**',
'.github/CODEOWNERS',
'translations/**',
'assets/fonts/**',
'data/graphql/**',
'lib/graphql/**',
'lib/redirects/**',
'lib/rest/**',
'lib/webhooks/**'
]

let reviewMessage = `👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions.\n${markdownFiles}\n\nYou'll need to revert all of these ☝️ files using [GitHub Desktop](https://docs.github.com/en/free-pro-team@latest/desktop/contributing-and-collaborating-using-github-desktop/reverting-a-commit) or \`git checkout origin/main <file name>\`. Once you get those files reverted, we can continue with the review process. :octocat:`
const badFiles = badFilesArr.join('\n')

if (restFiles.length > 0) {
reviewMessage += "\n\nIt looks like you've modified the OpenAPI schema (`lib/rest/static/**`). While we aren't accepting changes to the schema directly, you can open an issue for any updates to the REST API docs. Head on over to the [`github/rest-api-description`](https://github.com/github/rest-api-description/issues/new?assignees=&labels=Inaccuracy&template=schema-inaccuracy.md&title=%5BSchema+Inaccuracy%5D+%3CDescribe+Problem%3E) repository to open an issue. ⚡"
}

if (translationFiles.length > 0) {
await github.issues.addLabels({
...context.repo,
issue_number: context.payload.number,
labels: ['localization']
})
reviewMessage += "\n\nIt looks like you've modified translated content. Unfortunately, we are not able to accept pull requests for translated content. Our translation process involves an integration with an external service at crowdin.com, where all translation activity happens. We hope to eventually open up the translation process to the open source community, but we're not there yet. See https://github.com/github/docs/blob/main/CONTRIBUTING.md#earth_asia-translations for more details."
}
let reviewMessage = `👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions. The complete list of files we can't accept are:\n${badFiles}\n\nYou'll need to revert all of the files you changed in that list using [GitHub Desktop](https://docs.github.com/en/free-pro-team@latest/desktop/contributing-and-collaborating-using-github-desktop/reverting-a-commit) or \`git checkout origin/main <file name>\`. Once you get those files reverted, we can continue with the review process. :octocat:`

await github.pulls.createReview({
...context.repo,
Expand Down