feat(tools): Add a PR labeler action to the repo (#41458)

pull/41464/head
Randell Dawson 2021-03-13 09:44:19 -07:00 committed by GitHub
parent f1c8a9825b
commit 50369edd12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 50 additions and 13 deletions

View File

@ -2,7 +2,7 @@
name: 'Bug Report: Issues with Coding challenges'
about: Report issue with a specific challenge, like broken tests, unclear instructions.
title: ''
labels: 'scope: learn, status: needs help for triage'
labels: 'scope: curriculum, status: needs help for triage'
assignees: ''
---

View File

@ -27,4 +27,4 @@ updates:
open-pull-requests-limit: 20
labels:
- 'dependabot'
- 'scope: learn'
- 'scope: curriculum'

25
.github/labeler.yml vendored Normal file
View File

@ -0,0 +1,25 @@
"scope: docs":
- docs/**/*
"scope: curriculum":
- curriculum/challenges/**/*
"platform: client":
- client/**/*
"platform: api":
- api-server/**/*
"scope: tools/scripts":
- cypress/**/*
- tools/**/*
- .github/**/*
- utils/**/*
"scope: i18n":
- any: ['curriculum/challenges/**/*', '!curriculum/challenges/english/**/*']
- docs/i18n/**/*
- client/i18n/**/*
- config/crowdin/**/*
- config/i18n/**/*
- tools/crowdin/**/*

View File

@ -100,5 +100,5 @@ jobs:
base: 'main'
title: 'chore(i18n,client): processed translations'
body: 'This PR was opened auto-magically by Crowdin.'
labels: 'crowdin-sync, scope: i18n, scope: UI'
labels: 'crowdin-sync, scope: UI'
reviewers: 'RandellDawson, nhcarrigan'

View File

@ -7,7 +7,7 @@ on:
jobs:
i18n-download-curriculum-translations:
name: Learn
name: Curriculum
runs-on: ubuntu-18.04
steps:
@ -66,8 +66,8 @@ jobs:
export_only_approved: true
commit_message: 'chore(i8n,learn): processed translations'
localization_branch_name: i18n-sync-learn
commit_message: 'chore(i8n,curriculum): processed translations'
localization_branch_name: i18n-sync-curriculum
push_translations: true
# pull-request
@ -96,10 +96,10 @@ jobs:
uses: ./tools/crowdin/actions/pr-creator
with:
github-token: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}
branch: 'i18n-sync-learn'
branch: 'i18n-sync-curriculum'
owner-repo: 'freeCodeCamp/freeCodeCamp'
base: 'main'
title: 'chore(i18n,learn): processed translations'
title: 'chore(i18n,curiculum): processed translations'
body: 'This PR was opened auto-magically by Crowdin.'
labels: 'crowdin-sync, scope: i18n, scope: learn'
labels: 'crowdin-sync'
reviewers: 'RandellDawson, nhcarrigan'

View File

@ -134,5 +134,5 @@ jobs:
base: 'main'
title: 'chore(i18n,docs): processed translations'
body: 'This PR was opened auto-magically by Crowdin.'
labels: 'crowdin-sync, scope: i18n, scope: docs'
labels: 'crowdin-sync'
reviewers: 'RandellDawson, nhcarrigan'

12
.github/workflows/labeler.yaml vendored Normal file
View File

@ -0,0 +1,12 @@
name: "Pull Request Labeler"
on:
- pull_request_target
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true

View File

@ -5,7 +5,7 @@ const validLabels = {
portuguese: 'language: Portuguese',
russian: 'language: Russian',
spanish: 'language: Spanish',
curriculum: 'scope: learn',
curriculum: 'scope: curriculum',
docs: 'scope: docs',
};

View File

@ -1,7 +1,7 @@
/*
This is a one-off script to run on all open PRs to add the
"status: need to test locally" label to any PR with an existing
"scope: learn" label on it.
"scope: curriculum" label on it.
*/
const {
@ -38,7 +38,7 @@ const log = new ProcessingLog('all-locally-tested-labels');
// holds potential labels to add based on file path
const labelsToAdd = {};
const existingLabels = labels.map(({ name }) => name);
if (existingLabels.includes('scope: learn')) {
if (existingLabels.includes('scope: curriculum')) {
labelsToAdd['status: need to test locally'] = 1;
}