From ce55b36a6e6b5e8370597c5194ace88f5d62f198 Mon Sep 17 00:00:00 2001 From: rzuckerm Date: Sat, 22 Nov 2025 14:41:56 -0600 Subject: [PATCH 1/4] Auto-generate labels for labeler --- .github/labeler.yml | 306 ------------------------------- .github/workflows/pr-labeler.yml | 22 +++ 2 files changed, 22 insertions(+), 306 deletions(-) delete mode 100644 .github/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index fc4202a82..000000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,306 +0,0 @@ -enhancement: -- changed-files: - - all-globs-to-all-files: - - '!archive/*/*/README.md' -- base-branch: main -needs docs: -- changed-files: - - any-glob-to-any-file: - - README.md - - .github/*.md -- base-branch: main -tests: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/testinfo.yml -- base-branch: main -baklava: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/Baklava.* - - archive/*/*/baklava.* -- base-branch: main -base64 encode decode: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/Base64EncodeDecode.* - - archive/*/*/base64-encode-decode.* - - archive/*/*/base64EncodeDecode.* - - archive/*/*/base64_encode_decode.* -- base-branch: main -binary search: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/BinarySearch.* - - archive/*/*/binary-search.* - - archive/*/*/binarySearch.* - - archive/*/*/binary_search.* -- base-branch: main -bubble sort: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/BubbleSort.* - - archive/*/*/bubble-sort.* - - archive/*/*/bubbleSort.* - - archive/*/*/bubble_sort.* -- base-branch: main -capitalize: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/Capitalize.* - - archive/*/*/capitalize.* -- base-branch: main -convex hull: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/ConvexHull.* - - archive/*/*/convex-hull.* - - archive/*/*/convexHull.* - - archive/*/*/convex_hull.* -- base-branch: main -depth first search: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/DepthFirstSearch.* - - archive/*/*/depth-first-search.* - - archive/*/*/depthFirstSearch.* - - archive/*/*/depth_first_search.* -- base-branch: main -dijkstra: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/Dijkstra.* - - archive/*/*/dijkstra.* -- base-branch: main -duplicate character counter: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/DuplicateCharacterCounter.* - - archive/*/*/duplicate-character-counter.* - - archive/*/*/duplicateCharacterCounter.* - - archive/*/*/duplicate_character_counter.* -- base-branch: main -even odd: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/EvenOdd.* - - archive/*/*/even-odd.* - - archive/*/*/evenOdd.* - - archive/*/*/even_odd.* -- base-branch: main -factorial: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/Factorial.* - - archive/*/*/factorial.* -- base-branch: main -fibonacci: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/Fibonacci.* - - archive/*/*/fibonacci.* -- base-branch: main -file input output: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/FileInputOutput.* - - archive/*/*/file-input-output.* - - archive/*/*/fileInputOutput.* - - archive/*/*/file_input_output.* -- base-branch: main -fizz buzz: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/FizzBuzz.* - - archive/*/*/fizz-buzz.* - - archive/*/*/fizzBuzz.* - - archive/*/*/fizz_buzz.* -- base-branch: main -fraction math: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/FractionMath.* - - archive/*/*/fraction-math.* - - archive/*/*/fractionMath.* - - archive/*/*/fraction_math.* -- base-branch: main -hello world: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/HelloWorld.* - - archive/*/*/hello-world.* - - archive/*/*/helloWorld.* - - archive/*/*/hello_world.* -- base-branch: main -insertion sort: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/InsertionSort.* - - archive/*/*/insertion-sort.* - - archive/*/*/insertionSort.* - - archive/*/*/insertion_sort.* -- base-branch: main -job sequencing: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/JobSequencing.* - - archive/*/*/job-sequencing.* - - archive/*/*/jobSequencing.* - - archive/*/*/job_sequencing.* -- base-branch: main -josephus problem: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/JosephusProblem.* - - archive/*/*/josephus-problem.* - - archive/*/*/josephusProblem.* - - archive/*/*/josephus_problem.* -- base-branch: main -linear search: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/LinearSearch.* - - archive/*/*/linear-search.* - - archive/*/*/linearSearch.* - - archive/*/*/linear_search.* -- base-branch: main -longest common subsequence: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/LongestCommonSubsequence.* - - archive/*/*/longest-common-subsequence.* - - archive/*/*/longestCommonSubsequence.* - - archive/*/*/longest_common_subsequence.* -- base-branch: main -longest palindromic substring: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/LongestPalindromicSubstring.* - - archive/*/*/longest-palindromic-substring.* - - archive/*/*/longestPalindromicSubstring.* - - archive/*/*/longest_palindromic_substring.* -- base-branch: main -longest word: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/LongestWord.* - - archive/*/*/longest-word.* - - archive/*/*/longestWord.* - - archive/*/*/longest_word.* -- base-branch: main -maximum array rotation: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/MaximumArrayRotation.* - - archive/*/*/maximum-array-rotation.* - - archive/*/*/maximumArrayRotation.* - - archive/*/*/maximum_array_rotation.* -- base-branch: main -maximum subarray: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/MaximumSubarray.* - - archive/*/*/maximum-subarray.* - - archive/*/*/maximumSubarray.* - - archive/*/*/maximum_subarray.* -- base-branch: main -merge sort: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/MergeSort.* - - archive/*/*/merge-sort.* - - archive/*/*/mergeSort.* - - archive/*/*/merge_sort.* -- base-branch: main -minimum spanning tree: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/MinimumSpanningTree.* - - archive/*/*/minimum-spanning-tree.* - - archive/*/*/minimumSpanningTree.* - - archive/*/*/minimum_spanning_tree.* -- base-branch: main -palindromic number: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/PalindromicNumber.* - - archive/*/*/palindromic-number.* - - archive/*/*/palindromicNumber.* - - archive/*/*/palindromic_number.* -- base-branch: main -prime number: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/PrimeNumber.* - - archive/*/*/prime-number.* - - archive/*/*/primeNumber.* - - archive/*/*/prime_number.* -- base-branch: main -quick sort: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/QuickSort.* - - archive/*/*/quick-sort.* - - archive/*/*/quickSort.* - - archive/*/*/quick_sort.* -- base-branch: main -quine: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/Quine.* - - archive/*/*/quine.* -- base-branch: main -remove all whitespace: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/RemoveAllWhitespace.* - - archive/*/*/remove-all-whitespace.* - - archive/*/*/removeAllWhitespace.* - - archive/*/*/remove_all_whitespace.* -- base-branch: main -reverse string: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/ReverseString.* - - archive/*/*/reverse-string.* - - archive/*/*/reverseString.* - - archive/*/*/reverse_string.* -- base-branch: main -roman numeral: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/RomanNumeral.* - - archive/*/*/roman-numeral.* - - archive/*/*/romanNumeral.* - - archive/*/*/roman_numeral.* -- base-branch: main -rot13: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/Rot13.* - - archive/*/*/rot13.* -- base-branch: main -selection sort: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/SelectionSort.* - - archive/*/*/selection-sort.* - - archive/*/*/selectionSort.* - - archive/*/*/selection_sort.* -- base-branch: main -sleep sort: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/SleepSort.* - - archive/*/*/sleep-sort.* - - archive/*/*/sleepSort.* - - archive/*/*/sleep_sort.* -- base-branch: main -transpose matrix: -- changed-files: - - any-glob-to-any-file: - - archive/*/*/TransposeMatrix.* - - archive/*/*/transpose-matrix.* - - archive/*/*/transposeMatrix.* - - archive/*/*/transpose_matrix.* -- base-branch: main diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 0b92f5f5f..ce8ba915a 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -15,6 +15,28 @@ jobs: steps: - uses: actions/checkout@v6 + - name: Read repo config + uses: pietrobolcato/action-read-yaml@1.1.0 + id: repo-config + with: + config: repo-config.yml + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "${{ steps.repo-config.outputs['python-version'] }}" + + - name: Run Poetry Image + uses: abatilo/actions-poetry@v3 + with: + poetry-version: "${{ steps.repo-config.outputs['poetry-version'] }}" + + - name: Install Dependencies + run: poetry install + + - name: Create labels + run: poetry run python scripts/set_up_labeler.py + - uses: actions/labeler@v6 with: repo-token: ${{ secrets.GITHUB_TOKEN }} From e7cb1d935134adde2dd22b3fb7fd1f2d1a095d22 Mon Sep 17 00:00:00 2001 From: rzuckerm Date: Sat, 22 Nov 2025 14:46:05 -0600 Subject: [PATCH 2/4] Try PAT instead of GITHUB_TOKEN --- .github/workflows/pr-labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index ce8ba915a..5388ec972 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -39,5 +39,5 @@ jobs: - uses: actions/labeler@v6 with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token: ${{ secrets.PAT }} sync-labels: true From a4f44fb82cd3bf9b4fdec74acf0f005f37fe1a3e Mon Sep 17 00:00:00 2001 From: rzuckerm Date: Sat, 22 Nov 2025 14:51:49 -0600 Subject: [PATCH 3/4] Try adding issues write --- .github/workflows/pr-labeler.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 5388ec972..1c8ca5d40 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -10,6 +10,7 @@ jobs: labeler: permissions: contents: read + issues: write pull-requests: write runs-on: ubuntu-latest steps: @@ -39,5 +40,5 @@ jobs: - uses: actions/labeler@v6 with: - repo-token: ${{ secrets.PAT }} + repo-token: ${{ secrets.GITHUB_TOKEN }} sync-labels: true From 3e15e171172deea47cf1564d34d366b0d9d13489 Mon Sep 17 00:00:00 2001 From: rzuckerm Date: Sat, 22 Nov 2025 15:01:30 -0600 Subject: [PATCH 4/4] Try pull_request_target --- .github/workflows/pr-labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 1c8ca5d40..d65bc037c 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -1,7 +1,7 @@ name: "Pull Request Labeler" on: - pull_request: + pull_request_target: types: - opened - synchronize