From 3c3362b7c2be7db073770a7e6e79e402ccaa7809 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Fri, 3 May 2024 11:41:02 +0200 Subject: [PATCH] Google Analytics: automatically label changes to package See #37137 --- .../changelog/update-repo-gardening-google-analytics | 4 ++++ .../repo-gardening/src/tasks/add-labels/index.js | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 projects/github-actions/repo-gardening/changelog/update-repo-gardening-google-analytics diff --git a/projects/github-actions/repo-gardening/changelog/update-repo-gardening-google-analytics b/projects/github-actions/repo-gardening/changelog/update-repo-gardening-google-analytics new file mode 100644 index 0000000000000..2fe3a3aa7912e --- /dev/null +++ b/projects/github-actions/repo-gardening/changelog/update-repo-gardening-google-analytics @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Auto-labeling: label changes to the Google Analytics package. diff --git a/projects/github-actions/repo-gardening/src/tasks/add-labels/index.js b/projects/github-actions/repo-gardening/src/tasks/add-labels/index.js index c8c9a75154e66..5eda4953e5972 100644 --- a/projects/github-actions/repo-gardening/src/tasks/add-labels/index.js +++ b/projects/github-actions/repo-gardening/src/tasks/add-labels/index.js @@ -143,6 +143,12 @@ async function getLabelsToAdd( octokit, owner, repo, number, isDraft, isRevert ) keywords.add( '[Feature] SSO' ); } + // The Google Analytics feature nows lives in both a package and a Jetpack module. + const googleAnalytics = file.match( /^projects\/packages\/google-analytics\// ); + if ( googleAnalytics !== null ) { + keywords.add( '[Feature] Google Analytics' ); + } + // The WooCommerce Analytics feature now lives in both a package and a Jetpack module. const wooCommerceAnalytics = file.match( /^projects\/packages\/woocommerce-analytics\// ); if ( wooCommerceAnalytics !== null ) {