-
-
Notifications
You must be signed in to change notification settings - Fork 927
32 lines (28 loc) · 1.13 KB
/
commenting-on-old-issues.yml
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
name: Commenting on old issues
on:
schedule:
- cron: '0 0 * * *' # Every day at 00:00 UTC
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Comment on old issues
run: |
one_month_ago=$(date --date '1 month ago' '+%Y-%m-%d')
# For the search syntax, see https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests
old_issue_urls=$(gh issue list \
--search "is:open updated:<${one_month_ago} label:\"status: ready to implement\"" \
--json 'url' \
--jq '.[] | .url')
for url in ${old_issue_urls}; do
gh issue comment "${url}" --body "${issue_comment}"
gh issue edit "${url}" --add-label 'status: ask to implement' --remove-label 'status: ready to implement'
done
env:
GH_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
issue_comment: |-
This issue is older than one month. Please ask before opening a pull request, as it may no longer be relevant.