From 48f44d6f0273e9bc016fbfe097bc98a3a658b2ca Mon Sep 17 00:00:00 2001 From: timflannagan Date: Tue, 14 Jan 2025 23:05:32 +0000 Subject: [PATCH] ASDF Signed-off-by: timflannagan --- .github/workflows/changelog.yaml | 46 +++++++------------------------- Makefile | 2 +- 2 files changed, 11 insertions(+), 37 deletions(-) diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml index 30bea12c3f2..0bffef58568 100644 --- a/.github/workflows/changelog.yaml +++ b/.github/workflows/changelog.yaml @@ -4,42 +4,16 @@ on: pull_request: types: [opened, edited, reopened, synchronize] +permissions: + issues: write + jobs: - label-kind: + kind-label: runs-on: ubuntu-latest steps: - - name: Check PR description for kind and add label - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - // Get the pull request from the event payload - const pr = context.payload.pull_request; - if (!pr) { - core.info('No pull request found'); - return; - } - - // Extract the body of the pull request - const body = pr.body || ""; - - // Search for a "/kind enhancement" directive using regex - const match = body.match(/\/kind\s+(enhancement)/i); - if (match) { - // Extracted kind from the description - const kindLabel = match[1].toLowerCase(); - - core.info(`Found kind: ${kindLabel}. Adding label...`); - - // Add the label to the pull request - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pr.number, - labels: [kindLabel] - }); - - core.info(`Label "${kindLabel}" added to PR #${pr.number}.`); - } else { - core.info('No /kind enhancement found in the PR description.'); - } + - name: enhancement + if: contains(github.event.pull_request.description, '/kind enhancement') + uses: christianvuerings/add-labels@v1 + with: + labels: | + kind/enhancement diff --git a/Makefile b/Makefile index aa4703b341c..02c74ee8ab6 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ .PHONY: help help: NAME_COLUMN_WIDTH=35 help: LINE_COLUMN_WIDTH=5 -help: ## Output the self-documenting make targets +help: ## Output the self-documenting make targets ASDF @grep -hnE '^[%a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = "[:]|(## )"}; {printf "\033[36mL%-$(LINE_COLUMN_WIDTH)s%-$(NAME_COLUMN_WIDTH)s\033[0m %s\n", $$1, $$2, $$4}' #----------------------------------------------------------------------------------