Skip to content

Commit 0073ab6

Browse files
ybiquitousjeddy3
andauthored
Add GitHub action to change the label and add a warning comment on issues older than a month (#7486)
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
1 parent baaf8f7 commit 0073ab6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Commenting on old issues
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Every day at 00:00 UTC
6+
workflow_dispatch:
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
steps:
14+
- name: Comment on old issues
15+
run: |
16+
one_month_ago=$(date --date '1 month ago' '+%Y-%m-%d')
17+
18+
# For the search syntax, see https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests
19+
old_issue_urls=$(gh issue list \
20+
--search "is:open updated:<${one_month_ago} label:\"status: ready to implement\"" \
21+
--json 'url' \
22+
--jq '.[] | .url')
23+
24+
for url in ${old_issue_urls}; do
25+
gh issue comment "${url}" --body "${issue_comment}"
26+
gh issue edit "${url}" --add-label 'status: ask to implement' --remove-label 'status: ready to implement'
27+
done
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
issue_comment: |-
31+
This issue is older than one month. Please ask before opening a pull request, as it may no longer be relevant.

0 commit comments

Comments
 (0)