Skip to content

Commit ef1e00d

Browse files
authored
Merge pull request #126 from appwrite/copilot/rework-stale-workflow
Convert stale.yml to reusable workflow
2 parents cf47695 + 6473ca1 commit ef1e00d

File tree

1 file changed

+56
-11
lines changed

1 file changed

+56
-11
lines changed

.github/workflows/stale.yml

Lines changed: 56 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,53 @@
11
name: Mark stale issues
22

33
on:
4-
schedule:
5-
- cron: "0 0 * * *" # Midnight Runtime
4+
workflow_call:
5+
inputs:
6+
stale-issue-message:
7+
description: 'Message to post on issues when marking them as stale'
8+
required: false
9+
type: string
10+
default: "This issue has been labeled as a 'question', indicating that it requires additional information from the requestor. It has been inactive for 7 days. If no further activity occurs, this issue will be closed in 14 days."
11+
stale-issue-label:
12+
description: 'Label to apply to stale issues'
13+
required: false
14+
type: string
15+
default: 'stale'
16+
days-before-stale:
17+
description: 'Number of days of inactivity before an issue is marked as stale'
18+
required: false
19+
type: number
20+
default: 7
21+
days-before-close:
22+
description: 'Number of days of inactivity before a stale issue is closed'
23+
required: false
24+
type: number
25+
default: 14
26+
remove-stale-when-updated:
27+
description: 'Remove stale label when an issue is updated'
28+
required: false
29+
type: boolean
30+
default: true
31+
close-issue-message:
32+
description: 'Message to post on issues when closing them'
33+
required: false
34+
type: string
35+
default: "This issue has been closed due to inactivity. If you still require assistance, please provide the requested information."
36+
close-issue-reason:
37+
description: 'Reason for closing the issue (completed, not_planned, reopened)'
38+
required: false
39+
type: string
40+
default: 'not_planned'
41+
operations-per-run:
42+
description: 'Maximum number of operations per run'
43+
required: false
44+
type: number
45+
default: 100
46+
only-labels:
47+
description: 'Only process issues with these labels (comma separated)'
48+
required: false
49+
type: string
50+
default: 'question'
651

752
jobs:
853
stale:
@@ -12,12 +57,12 @@ jobs:
1257
- uses: actions/stale@v9
1358
with:
1459
repo-token: ${{ secrets.GITHUB_TOKEN }}
15-
stale-issue-message: "This issue has been labeled as a 'question', indicating that it requires additional information from the requestor. It has been inactive for 7 days. If no further activity occurs, this issue will be closed in 14 days."
16-
stale-issue-label: "stale"
17-
days-before-stale: 7
18-
days-before-close: 14
19-
remove-stale-when-updated: true
20-
close-issue-message: "This issue has been closed due to inactivity. If you still require assistance, please provide the requested information."
21-
close-issue-reason: "not_planned"
22-
operations-per-run: 100
23-
only-labels: "question"
60+
stale-issue-message: ${{ inputs.stale-issue-message }}
61+
stale-issue-label: ${{ inputs.stale-issue-label }}
62+
days-before-stale: ${{ inputs.days-before-stale }}
63+
days-before-close: ${{ inputs.days-before-close }}
64+
remove-stale-when-updated: ${{ inputs.remove-stale-when-updated }}
65+
close-issue-message: ${{ inputs.close-issue-message }}
66+
close-issue-reason: ${{ inputs.close-issue-reason }}
67+
operations-per-run: ${{ inputs.operations-per-run }}
68+
only-labels: ${{ inputs.only-labels }}

0 commit comments

Comments
 (0)