Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃尡 automate adding labels to pull requests #94

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: '**'
Comment on lines +23 to +25
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this adds Container label to every patch.

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"]
}
29 changes: 29 additions & 0 deletions .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Label issues And add to projects
on:
issues:
types:
- reopened
- opened
jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: Container

add-to-project:
name: Add pull request to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/SovereignCloudStack/projects/6
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
labeled: Container
label-operator: AND
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 }}
Loading