From 239839732710dbbefe23b8e421ed40edbb516baf Mon Sep 17 00:00:00 2001 From: Srinivas Chippagiri Date: Sun, 22 Nov 2026 00:57:18 -0800 Subject: [PATCH] ci: label PRs by changed paths and mark inactive issues and PRs as stale --- .github/labeler.yml | 19 +++++++++++++++++++ .github/workflows/labeler.yml | 20 ++++++++++++++++++++ .github/workflows/stale.yml | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..3c8def1 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,19 @@ +code: + - changed-files: + - any-glob-to-any-file: "docform/**" + +tests: + - changed-files: + - any-glob-to-any-file: "tests/**" + +documentation: + - changed-files: + - any-glob-to-any-file: ["docs/**", "*.rst", "README*"] + +examples: + - changed-files: + - any-glob-to-any-file: "examples/**" + +github_actions: + - changed-files: + - any-glob-to-any-file: ".github/**" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..36a69d1 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,20 @@ +name: labeler + +# pull_request_target lets this label PRs from forks. It never checks out +# the PR's code, it only reads the list of changed files. +on: + pull_request_target: + types: [opened, synchronize, reopened] + +permissions: + contents: read + +jobs: + label: + name: Label by changed paths + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/labeler@v7 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..eaf2b19 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,35 @@ +name: stale + +on: + schedule: + - cron: "30 4 * * *" + workflow_dispatch: + +permissions: + contents: read + +jobs: + stale: + name: Mark inactive issues and PRs + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v11 + with: + days-before-issue-stale: 90 + days-before-pr-stale: 60 + # Only mark as stale, never close. + days-before-close: -1 + stale-issue-label: stale + stale-pr-label: stale + exempt-issue-labels: pinned,security,help wanted,good first issue + exempt-pr-labels: pinned,security,dependencies,port + exempt-all-milestones: true + stale-issue-message: > + This issue hasn't had any activity in 90 days, so it's been marked + stale. Any new comment or update removes the label. + stale-pr-message: > + This PR hasn't had any activity in 60 days, so it's been marked + stale. Any new comment or push removes the label.