From 50369edd12ae6575c288a775bbd309c91b698166 Mon Sep 17 00:00:00 2001 From: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Date: Sat, 13 Mar 2021 09:44:19 -0700 Subject: [PATCH] feat(tools): Add a PR labeler action to the repo (#41458) --- ...g-report--issues-with-coding-challenges.md | 2 +- .github/dependabot.yml | 2 +- .github/labeler.yml | 25 +++++++++++++++++++ .../crowdin-i18n-client-ui-download.yml | 2 +- .../crowdin-i18n-curriculum-download.yml | 12 ++++----- .../workflows/crowdin-i18n-docs-download..yml | 2 +- .github/workflows/labeler.yaml | 12 +++++++++ .../lib/validation/valid-labels.js | 2 +- .../one-off-scripts/add-test-locally-label.js | 4 +-- 9 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yaml diff --git a/.github/ISSUE_TEMPLATE/bug-report--issues-with-coding-challenges.md b/.github/ISSUE_TEMPLATE/bug-report--issues-with-coding-challenges.md index a0ae93c379d..5cbf642e60f 100644 --- a/.github/ISSUE_TEMPLATE/bug-report--issues-with-coding-challenges.md +++ b/.github/ISSUE_TEMPLATE/bug-report--issues-with-coding-challenges.md @@ -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: '' --- diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 801320acc4d..57d6d2d7a4e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -27,4 +27,4 @@ updates: open-pull-requests-limit: 20 labels: - 'dependabot' - - 'scope: learn' + - 'scope: curriculum' diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000000..7f1369a302d --- /dev/null +++ b/.github/labeler.yml @@ -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/**/* diff --git a/.github/workflows/crowdin-i18n-client-ui-download.yml b/.github/workflows/crowdin-i18n-client-ui-download.yml index e86c6754301..4ebae860516 100644 --- a/.github/workflows/crowdin-i18n-client-ui-download.yml +++ b/.github/workflows/crowdin-i18n-client-ui-download.yml @@ -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' diff --git a/.github/workflows/crowdin-i18n-curriculum-download.yml b/.github/workflows/crowdin-i18n-curriculum-download.yml index 963ff945952..c868a6a6ae5 100644 --- a/.github/workflows/crowdin-i18n-curriculum-download.yml +++ b/.github/workflows/crowdin-i18n-curriculum-download.yml @@ -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' diff --git a/.github/workflows/crowdin-i18n-docs-download..yml b/.github/workflows/crowdin-i18n-docs-download..yml index 854b59f8b80..3e668e5a98c 100644 --- a/.github/workflows/crowdin-i18n-docs-download..yml +++ b/.github/workflows/crowdin-i18n-docs-download..yml @@ -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' diff --git a/.github/workflows/labeler.yaml b/.github/workflows/labeler.yaml new file mode 100644 index 00000000000..0d40ed33442 --- /dev/null +++ b/.github/workflows/labeler.yaml @@ -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 \ No newline at end of file diff --git a/tools/contributor/lib/validation/valid-labels.js b/tools/contributor/lib/validation/valid-labels.js index a827354d458..41031191196 100644 --- a/tools/contributor/lib/validation/valid-labels.js +++ b/tools/contributor/lib/validation/valid-labels.js @@ -5,7 +5,7 @@ const validLabels = { portuguese: 'language: Portuguese', russian: 'language: Russian', spanish: 'language: Spanish', - curriculum: 'scope: learn', + curriculum: 'scope: curriculum', docs: 'scope: docs', }; diff --git a/tools/contributor/one-off-scripts/add-test-locally-label.js b/tools/contributor/one-off-scripts/add-test-locally-label.js index 5980366a5f9..0a1a6a5ad32 100644 --- a/tools/contributor/one-off-scripts/add-test-locally-label.js +++ b/tools/contributor/one-off-scripts/add-test-locally-label.js @@ -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; }