From bfb24c59876450f6307d690e0680e4ea009f87ba Mon Sep 17 00:00:00 2001 From: Sebastian Spier Date: Tue, 10 Oct 2023 23:10:23 +0200 Subject: [PATCH 1/2] Make the list of CODEOWNERS uniq. Mostly a cosmetic change to make the SEARCH_QUERY shorter --- .github/workflows/pattern-metrics.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pattern-metrics.yaml b/.github/workflows/pattern-metrics.yaml index f101a4a6d..63e0a7a46 100644 --- a/.github/workflows/pattern-metrics.yaml +++ b/.github/workflows/pattern-metrics.yaml @@ -44,7 +44,7 @@ jobs: # Extract words from CODEOWNERS that start with @ and convert them into a comma-separated string # ie, "-author:spier -author:zkoppert" # This will be used to filter out these codeowners from certain stats in later steps - CODEOWNERS_FILTER=$(echo $CODEOWNERS_FILE | grep -o "@[a-zA-Z0-9\-]*" | sed 's/@/-author:/g' | tr '\n' ' ') + CODEOWNERS_FILTER=$(echo $CODEOWNERS_FILE | grep -o "@[a-zA-Z0-9\-]*" | sed 's/@/-author:/g' | sort | uniq | tr '\n' ' ') # Print usernames to terminal for easy debugging echo "CODEOWNERS_FILTER: $CODEOWNERS_FILTER" @@ -99,7 +99,7 @@ jobs: # Extract words from CODEOWNERS that start with @ and convert them into a comma-separated string # ie, "-author:spier -author:zkoppert" # This will be used to filter out these codeowners from certain stats in later steps - CODEOWNERS_FILTER=$(echo $CODEOWNERS_FILE | grep -o "@[a-zA-Z0-9\-]*" | sed 's/@/-author:/g' | tr '\n' ' ') + CODEOWNERS_FILTER=$(echo $CODEOWNERS_FILE | grep -o "@[a-zA-Z0-9\-]*" | sed 's/@/-author:/g' | sort | uniq | tr '\n' ' ') # Print usernames to terminal for easy debugging echo "CODEOWNERS_FILTER: $CODEOWNERS_FILTER" From 24857097636ec2ed942e57c6bef25bf74b2cb533 Mon Sep 17 00:00:00 2001 From: Sebastian Spier Date: Tue, 10 Oct 2023 23:11:05 +0200 Subject: [PATCH 2/2] Use sparse-checkout for the 2nd job as well --- .github/workflows/pattern-metrics.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pattern-metrics.yaml b/.github/workflows/pattern-metrics.yaml index 63e0a7a46..4359a43ca 100644 --- a/.github/workflows/pattern-metrics.yaml +++ b/.github/workflows/pattern-metrics.yaml @@ -89,6 +89,10 @@ jobs: - name: Check out the code so we can get the CODEOWNERS names uses: actions/checkout@v4 + with: + sparse-checkout: | + .github/CODEOWNERS + sparse-checkout-cone-mode: false - name: Get usernames from CODEOWNERS file shell: bash