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' name: 'Bug Report: Issues with Coding challenges'
about: Report issue with a specific challenge, like broken tests, unclear instructions. about: Report issue with a specific challenge, like broken tests, unclear instructions.
title: '' title: ''
labels: 'scope: learn, status: needs help for triage' labels: 'scope: curriculum, status: needs help for triage'
assignees: '' assignees: ''
--- ---

View File

@ -27,4 +27,4 @@ updates:
open-pull-requests-limit: 20 open-pull-requests-limit: 20
labels: labels:
- 'dependabot' - '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' base: 'main'
title: 'chore(i18n,client): processed translations' title: 'chore(i18n,client): processed translations'
body: 'This PR was opened auto-magically by Crowdin.' body: 'This PR was opened auto-magically by Crowdin.'
labels: 'crowdin-sync, scope: i18n, scope: UI' labels: 'crowdin-sync, scope: UI'
reviewers: 'RandellDawson, nhcarrigan' reviewers: 'RandellDawson, nhcarrigan'

View File

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

View File

@ -134,5 +134,5 @@ jobs:
base: 'main' base: 'main'
title: 'chore(i18n,docs): processed translations' title: 'chore(i18n,docs): processed translations'
body: 'This PR was opened auto-magically by Crowdin.' body: 'This PR was opened auto-magically by Crowdin.'
labels: 'crowdin-sync, scope: i18n, scope: docs' labels: 'crowdin-sync'
reviewers: 'RandellDawson, nhcarrigan' 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', portuguese: 'language: Portuguese',
russian: 'language: Russian', russian: 'language: Russian',
spanish: 'language: Spanish', spanish: 'language: Spanish',
curriculum: 'scope: learn', curriculum: 'scope: curriculum',
docs: 'scope: docs', docs: 'scope: docs',
}; };

View File

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