From 90c07e0aee145aec6988b2424e4189461ceda82a Mon Sep 17 00:00:00 2001 From: M57 <41645758+Hy4ri@users.noreply.github.com> Date: Fri, 21 Aug 2026 20:49:41 +0300 Subject: [PATCH] ci(qol): path auto-labeler + stale bot (#949) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci(qol): add path auto-labeler, stale bot, PR size labels * ci(qol): drop PR size labels — not wanted --------- Co-authored-by: M57 --- .github/labeler.yml | 23 +++++++++++++++++++ .github/workflows/pr-labeler.yml | 25 +++++++++++++++++++++ .github/workflows/stale.yml | 38 ++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/pr-labeler.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..41baa172 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,23 @@ +# Path-based PR auto-labels (used by .github/workflows/pr-labeler.yml). +# Additive only — labels added by hand or Dependabot are never removed. +# All labels here already exist in the repo. + +documentation: + - changed-files: + - any-glob-to-any-file: + - "docs/**" + - "README.md" + - "CONTRIBUTING.md" + - "AGENTS.md" + +ci: + - changed-files: + - any-glob-to-any-file: + - ".github/**" + +testing: + - changed-files: + - any-glob-to-any-file: + - "app/src/test/**" + - "app/src/androidTest/**" + - "**/*Test.kt" diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml new file mode 100644 index 00000000..dfd98a0a --- /dev/null +++ b/.github/workflows/pr-labeler.yml @@ -0,0 +1,25 @@ +name: PR Auto-Labeler + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: [main] + +permissions: + contents: read + pull-requests: write + +concurrency: + group: labeler-${{ github.ref }} + cancel-in-progress: true + +jobs: + label: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Label by changed files + uses: actions/labeler@v6 + # Reads .github/labeler.yml. Additive only (sync-labels defaults to + # false), so manually-added labels and Dependabot's `dependencies` + # label are never touched. diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..025ff6a6 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,38 @@ +name: Stale Bot + +on: + schedule: + # Daily at 06:17 UTC (odd minute to avoid the :00 cron stampede). + - cron: "17 6 * * *" + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Close stale waiting-for-response items + uses: actions/stale@v9 + with: + # Only issues/PRs already marked `waiting-for-response` are candidates. + # Everything else is left completely alone. + only-labels: "waiting-for-response" + days-before-stale: 7 + days-before-close: 7 + stale-issue-label: "stale" + stale-pr-label: "stale" + stale-issue-message: >- + This has been marked `waiting-for-response` for a week with no reply. + It will be closed in another week if there's still no response. + stale-pr-message: >- + This has been marked `waiting-for-response` for a week with no reply. + It will be closed in another week if there's still no response. + close-issue-message: >- + Closing due to no response. Feel free to reopen anytime! + close-pr-message: >- + Closing due to no response. Feel free to reopen anytime! + operations-per-run: 30