From d096fa6d27d4f1ac59a604bf039f6a44cf86c44b Mon Sep 17 00:00:00 2001 From: Anthonius Munthi Date: Sun, 18 Aug 2024 10:18:06 +0000 Subject: [PATCH] chore(ci): added labeler action --- .github/labeler.yaml | 19 +++++++++++++++++ .github/labels.yaml | 35 +++++++++++++++++++++++++++++++ .github/release.yaml | 10 +++++++-- .github/renovate.json5 | 3 ++- .github/renovate/labels.json5 | 33 +++++++++++++++++++++++++++++ .github/workflows/label-sync.yaml | 30 ++++++++++++++++++++++++++ .github/workflows/labeler.yaml | 21 +++++++++++++++++++ 7 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 .github/labeler.yaml create mode 100644 .github/labels.yaml create mode 100644 .github/renovate/labels.json5 create mode 100644 .github/workflows/label-sync.yaml create mode 100644 .github/workflows/labeler.yaml diff --git a/.github/labeler.yaml b/.github/labeler.yaml new file mode 100644 index 0000000..843a324 --- /dev/null +++ b/.github/labeler.yaml @@ -0,0 +1,19 @@ +--- +# Areas +area/docs: + - changed-files: + - any-glob-to-any-file: + - "docs/**/*" + - "README.md" +area/github: + - changed-files: + - any-glob-to-any-file: ".github/**/*" +area/preflight: + - changed-files: + - any-glob-to-any-file: "preflight/**/*" +area/service: + - changed-files: + - any-glob-to-any-file: "service/**/*" +area/workstation: + - changed-files: + - any-glob-to-any-file: "service/**/*" diff --git a/.github/labels.yaml b/.github/labels.yaml new file mode 100644 index 0000000..f08e27f --- /dev/null +++ b/.github/labels.yaml @@ -0,0 +1,35 @@ +--- +# Areas +- name: area/docs + color: "0e8a16" +- name: area/github + color: "0e8a16" +- name: area/preflight + color: "0e8a16" +- name: area/service + color: "0e8a16" +- name: area/workstation + color: "ffc300" +# Renovate Types +- name: renovate/container + color: "027fa0" +- name: renovate/github-action + color: "027fa0" +- name: renovate/grafana-dashboard + color: "027fa0" +- name: renovate/github-release + color: "027fa0" +# Semantic Types +- name: type/digest + color: "ffeC19" +- name: type/patch + color: "ffeC19" +- name: type/minor + color: "ff9800" +- name: type/major + color: "f6412d" +# Uncategorized +- name: community + color: "370fb2" +- name: hold + color: "ee0701" diff --git a/.github/release.yaml b/.github/release.yaml index 1598e66..4464c20 100644 --- a/.github/release.yaml +++ b/.github/release.yaml @@ -1,4 +1,10 @@ changelog: exclude: - authors: - - renovate + authors: [] + categories: + - title: 🏕 Features + labels: + - '*' + exclude: + labels: + - dependencies diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 52e37fb..93e74c3 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -7,7 +7,8 @@ ":dependencyDashboard", ":semanticCommits", ":skipStatusChecks", - ":timezone(Asia/Makassar)" + ":timezone(Asia/Makassar)", + "github>kilip/homeplay//.github/renovate/labels.json5" ], "dependencyDashboardTitle": "Renovate Dashboard 🤖", "regexManagers": [ diff --git a/.github/renovate/labels.json5 b/.github/renovate/labels.json5 new file mode 100644 index 0000000..5509587 --- /dev/null +++ b/.github/renovate/labels.json5 @@ -0,0 +1,33 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "packageRules": [ + { + "matchUpdateTypes": ["major"], + "labels": ["type/major"] + }, + { + "matchUpdateTypes": ["minor"], + "labels": ["type/minor"] + }, + { + "matchUpdateTypes": ["patch"], + "labels": ["type/patch"] + }, + { + "matchUpdateTypes": ["digest"], + "labels": ["type/digest"] + }, + { + "matchDatasources": ["docker"], + "addLabels": ["renovate/container"] + }, + { + "matchDatasources": ["github-releases", "github-tags"], + "addLabels": ["renovate/github-release"] + }, + { + "matchManagers": ["github-actions"], + "addLabels": ["renovate/github-action"] + } + ] +} diff --git a/.github/workflows/label-sync.yaml b/.github/workflows/label-sync.yaml new file mode 100644 index 0000000..eeb26ef --- /dev/null +++ b/.github/workflows/label-sync.yaml @@ -0,0 +1,30 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: "Label Sync" + +on: + workflow_dispatch: + push: + branches: ["main"] + paths: [".github/labels.yaml"] + schedule: + - cron: "0 0 * * *" # Every day at midnight + +permissions: + issues: write + +jobs: + label-sync: + name: Label Sync + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + sparse-checkout: .github/labels.yaml + + - name: Sync Labels + uses: EndBug/label-sync@v2 + with: + config-file: .github/labels.yaml + delete-other-labels: true diff --git a/.github/workflows/labeler.yaml b/.github/workflows/labeler.yaml new file mode 100644 index 0000000..d658c1d --- /dev/null +++ b/.github/workflows/labeler.yaml @@ -0,0 +1,21 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: "Labeler" + +on: + workflow_dispatch: + pull_request_target: + branches: ["main"] + +jobs: + labeler: + name: Labeler + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Labeler + uses: actions/labeler@v5 + with: + configuration-path: .github/labeler.yaml