forked from open-edge-platform/anomalib
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (89 loc) · 3.32 KB
/
issue-management.yaml
File metadata and controls
94 lines (89 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Issue Management Workflow
#
# This workflow automates the triaging and maintenance of GitHub issues to
# ensure the project's issue tracker remains organized and up-to-date.
#
# Key Features:
# - Automated triage for new issues
# - Stale issue detection and closure
# - Differentiated handling for different issue types
# - Scheduled execution for routine cleanup
# - Welcome message for new contributors
#
# Process Stages:
# 1. New Issue Triage:
# - Triggered when a new issue is created.
# - Posts a comment acknowledging the submission and adding it to the triage queue.
#
# 2. Stale Issue Management:
# - Runs on a daily schedule.
# - Identifies issues that have been inactive for a specified period (90 days).
# - Applies a 'stale' label and posts a notification comment.
# - Closes stale issues if no further activity occurs after another 14 days.
#
# Required Secrets:
# - None
#
# Example Usage:
# Automatically triggered on:
# 1. New issue creation
# 2. Daily schedule (for stale check)
#
# Note:
# - Core work items (bugs, features, epics, etc.) are exempt from being marked stale.
# - Pull requests are not affected by this workflow.
name: Issue Management
on:
issues:
types: [opened]
schedule:
# Run daily at 5:00 UTC to check for stale issues
- cron: "0 5 * * *"
workflow_dispatch:
permissions: {} # No permissions by default on workflow level
jobs:
triage:
if: github.event_name == 'issues'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add triage comment
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: 'Thanks for submitting this issue! It has been added to our triage queue. A maintainer will review it shortly.'
});
stale:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10
with:
# Number of days of inactivity before an issue is marked as stale
days-before-stale: 90
# Number of days of inactivity before a stale issue is closed
days-before-close: 14
# Label to apply to stale issues
stale-issue-label: "stale"
# Comment to post when marking an issue as stale.
stale-issue-message: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue.
close-issue-message: >
This issue was closed because it has been stalled for 14 days with no activity.
# Labels that prevent an issue from ever being marked as stale.
# We exempt all work items that are part of the project's backlog.
exempt-issue-labels: "bug,enhancement,documentation,security,pinned,help-wanted,epic,user-story,task"
# Don't mark pull requests as stale
days-before-pr-stale: -1
days-before-pr-close: -1