Skip to content

Commit

Permalink
ASDF
Browse files Browse the repository at this point in the history
Signed-off-by: timflannagan <[email protected]>
  • Loading branch information
timflannagan committed Jan 14, 2025
1 parent 92c1ba1 commit 48f44d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 37 deletions.
46 changes: 10 additions & 36 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}'

#----------------------------------------------------------------------------------
Expand Down

0 comments on commit 48f44d6

Please sign in to comment.