Skip to content

Commit

Permalink
automate adding labels to pull requests
Browse files Browse the repository at this point in the history
this commit uses actions/labeler to automate
adding Container labels to pull requests.
For renovate PRs, it extends renovate
configuration so that renovate adds Container
label to the PR when a new dependency upgrade
pull request is created.

Signed-off-by: kranurag7 <[email protected]>
  • Loading branch information
kranurag7 authored and kranurag7 committed Jun 24, 2024
1 parent 1073f7d commit 41aa27e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 9 deletions.
27 changes: 18 additions & 9 deletions .github/labeler.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
---
area/code:
- "controllers/**/*"
- "pkg/**/*"
- changed-files:
- any-glob-to-any-file: "controllers/**/*"
- any-glob-to-any-file: "pkg/**/*"
area/api:
- "api/**/*"
- "config/crd/**/*"
- changed-files:
- any-glob-to-any-file: "api/**/*"
- any-glob-to-any-file: "config/crd/**/*"
area/github:
- ".github/**/*"
- changed-files:
- any-glob-to-any-file: ".github/**/*"
area/hack:
- "hack/**/*"
- "Makefile"
- changed-files:
- any-glob-to-any-file: "hack/**/*"
- any-glob-to-any-file: "Makefile"
area/test:
- "test/**/*"
- changed-files:
- any-glob-to-any-file: "test/**/*"
area/templates:
- "templates/**/*"
- changed-files:
- any-glob-to-any-file: "templates/**/*"
Container:
- changed-files:
- any-glob-to-any-file: '**'
4 changes: 4 additions & 0 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,7 @@
color: "7B55D7"
- name: question
color: "cc317c"
- name: Container
color: "0dce67"
description: >-
Container Infra and Tooling.
1 change: 1 addition & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@
separateMinorPatch: true,
enabledManagers: ["dockerfile", "gomod", "github-actions", "regex"],
recreateClosed: true,
labels: ["Container"]
}
19 changes: 19 additions & 0 deletions .github/workflows/pr-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,22 @@ jobs:

- name: Verify Shellcheck
run: make verify-shellcheck

- name: Generate Token
uses: actions/create-github-app-token@e8e39f73bb84fdf315a015fa3104f314c0a258b4 # v1
id: generate-token
with:
app-id: ${{ secrets.SCS_APP_ID }}
private-key: ${{ secrets.SCS_APP_PRIVATE_KEY }}

- name: Generate Labels
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5
with:
configuration-path: .github/labeler.yaml
repo-token: ${{ steps.generate-token.outputs.token }}

- name: Sync Labels
uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2
with:
config-file: .github/labels.yaml
token: ${{ steps.generate-token.outputs.token }}

0 comments on commit 41aa27e

Please sign in to comment.