Skip to content

Commit

Permalink
cicd: update stalebot
Browse files Browse the repository at this point in the history
* create reusable workflow
* add stale actions for high/medium/low priority labels
  • Loading branch information
korikuzma authored Jul 2, 2024
1 parent f70df54 commit c429db3
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 19 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/reusable-stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Reusable Stalebot Workflow

on:
workflow_call:
inputs:
days-before-close:
default: 14
type: number
days-before-issue-stale:
required: true
type: number
days-before-pr-stale:
required: true
type: number
exempt-labels:
default: stale-exempt
description: Comma-separated list of labels to exclude from stalebot
type: string
labels:
description: Comma-separated list of labels to apply to stalebot
required: true
type: string

jobs:
stale:
runs-on: ubuntu-latest
steps:
- name: Mark issues and PRs as stale
uses: actions/stale@v9
with:
only-labels: ${{ inputs.labels }}
exempt-issue-labels: ${{ inputs.exempt-labels }}
remove-stale-when-updated: true
days-before-close: ${{ inputs.days-before-close }}

days-before-issue-stale: ${{ inputs.days-before-issue-stale }}
stale-issue-label: stale
stale-issue-message: This issue is stale because it has been open ${{ inputs.days-before-issue-stale }} days with no activity. This issue will be closed if no further activity occurs in ${{ inputs.days-before-close }} days.
close-issue-label: closed-by-stale
close-issue-message: This issue was closed because it has been stalled for ${{ inputs.days-before-close }} days with no activity.

days-before-pr-stale: ${{ inputs.days-before-pr-stale }}
stale-pr-label: stale
stale-pr-message: This PR is stale because it has been open ${{ inputs.days-before-pr-stale }} day(s) with no activity. Please review this PR.
days-before-pr-close: -1
37 changes: 18 additions & 19 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,23 @@ on:
- cron: "30 13 * * *"

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
remove-stale-when-updated: true
days-before-close: 14
high-priority:
uses: ./.github/workflows/reusable-stale.yaml
with:
days-before-issue-stale: 90
days-before-pr-stale: 1
labels: priority:high

days-before-issue-stale: 60
stale-issue-label: stale
stale-issue-message: "This issue is stale because it has been open 45 days with no activity. Please make a comment for triaging or closing the issue."
close-issue-label: closed-by-stale
close-issue-message: "This issue was closed because it has been stalled for 14 days with no activity."
medium-priority:
uses: ./.github/workflows/reusable-stale.yaml
with:
days-before-issue-stale: 135
days-before-pr-stale: 3
labels: priority:medium

days-before-pr-stale: 7
stale-pr-label: stale
stale-pr-message: "This PR is stale because it has been open 7 days with no activity. Please review this PR."
days-before-pr-close: -1
low-priority:
uses: ./.github/workflows/reusable-stale.yaml
with:
days-before-issue-stale: 180
days-before-pr-stale: 7
labels: priority:low

0 comments on commit c429db3

Please sign in to comment.