Skip to content

Commit 1344251

Browse files
author
Lily
committed
Merge remote-tracking branch 'origin/main' into mobile
2 parents 804564d + 95acae6 commit 1344251

File tree

2 files changed

+69
-19
lines changed

2 files changed

+69
-19
lines changed

.github/workflows/autolock.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
name: Lock Closed Issues
2-
1+
name: Close inactive issues
32
on:
4-
workflow_dispatch
3+
schedule:
4+
- cron: "30 1 * * *"
55

66
jobs:
7-
lock-closed-issues:
7+
close-issues:
88
runs-on: ubuntu-latest
9+
permissions:
10+
issues: write
11+
pull-requests: write
912
steps:
10-
- name: Checkout repository
11-
uses: actions/checkout@v2
12-
13-
- name: Install jq
14-
run: sudo apt-get update && sudo apt-get install -y jq
15-
16-
- name: Lock closed issues
17-
run: |
18-
# Get a list of all closed issues in the repository
19-
issues=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/issues?state=closed" | jq -r '.[] | .number')
20-
21-
# Loop through each closed issue and lock it
22-
for issue in $issues; do
23-
curl -s -X PUT -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"locked":true}' "https://api.github.com/repos/${{ github.repository }}/issues/$issue/lock"
24-
done
13+
- uses: actions/stale@v5
14+
with:
15+
days-before-issue-stale: 30
16+
days-before-issue-close: 7
17+
stale-issue-label: "stale"
18+
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
19+
close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale."
20+
days-before-pr-stale: -1
21+
days-before-pr-close: -1
22+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/label-issue.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Issue Labeler"
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
- reopened
7+
- edited
8+
9+
jobs:
10+
# When an issue is opened, perform a similarity check for potential duplicates.
11+
# If some are found, add a label and comment listing the potential duplicate issues.
12+
potential-duplicate:
13+
name: Detect potential duplicate issues
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: wow-actions/potential-duplicates@v1
17+
with:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
# Issue title filter work with anymatch https://www.npmjs.com/package/anymatch.
20+
# Any matched issue will stop detection immediately.
21+
# You can specify multi filters in each line.
22+
filter: ''
23+
# Exclude keywords in title before detecting.
24+
exclude: ''
25+
# Label to set, when potential duplicates are detected.
26+
label: 'potential duplicate'
27+
# Get issues with state to compare. Supported state: 'all', 'closed', 'open'.
28+
state: all
29+
# If similarity is higher than this threshold([0,1]), issue will be marked as duplicate.
30+
# Turn this up if the detection is too sensitive
31+
threshold: 0.6
32+
# Reactions to be add to comment when potential duplicates are detected.
33+
# Available reactions: "-1", "+1", "confused", "laugh", "heart", "hooray", "rocket", "eyes"
34+
# reactions: '-1'
35+
# Comment to post when potential duplicates are detected.
36+
comment: >
37+
Potential duplicates: {{#issues}}
38+
- [#{{ number }}] {{ title }} ({{ accuracy }}%)
39+
{{/issues}}
40+
# When an issue is opened, detect if it has an empty body or incomplete issue form.
41+
# If it does, close the issue immediately.
42+
empty-issues:
43+
name: Close empty issues
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Run empty issues closer action
47+
uses: rickstaa/empty-issues-closer-action@v1
48+
env:
49+
github_token: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
close_comment: Closing this issue because it appears to be empty. Please update the issue for it to be reopened.
52+
open_comment: Reopening this issue because the author provided more information.

0 commit comments

Comments
 (0)