From c1909001a1619e1a635cfe108d233f00504d9222 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Fri, 22 Nov 2024 18:02:55 +0900 Subject: [PATCH 1/5] Update .github/workflows/close-stale-issues.yml: include PRs Signed-off-by: Suguru Hirahara --- .github/workflows/close-stale-issues.yml | 26 ++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index a05a4e3cb..93991b521 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -1,11 +1,12 @@ --- -name: 'Close stale issues' +name: 'Close stale issues and PRs' on: # yamllint disable-line rule:truthy schedule: - cron: '30 1 * * *' permissions: issues: write + pull-requests: write jobs: stale: @@ -14,14 +15,31 @@ jobs: steps: - uses: actions/stale@v9 with: - # Don't process pull requests at all - days-before-pr-stale: -1 + # An allow-list of label(s) to only process the issues/PRs which contain one of these label(s). + any-of-labels: 'needs-info' + ###################################################################### + # Issues + ###################################################################### stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.' close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity. If this issue is still reproduced, feel free to provide the issue with up-to-date information.' stale-issue-label: 'stale' # Add this label to exempt the issue from being marked as stale due to inactivity exempt-issue-labels: 'confirmed' # An allow-list of label(s) to only process the issues which contain one of these label(s). - any-of-issue-labels: 'question,needs-info' + any-of-issue-labels: 'question' + ###################################################################### + # PRs + ###################################################################### + days-before-pr-stale: '365' + days-before-pr-close: '30' + stale-pr-message: 'This PR is stale because it has been open a year with no activity. Remove stale label or this will be closed in 30 days.' + close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity.' + stale-pr-label: 'stale' + # Add this label to exempt the PR from being marked as stale due to inactivity + exempt-pr-labels: 'confirmed' + # An allow-list of label(s) to only process the PRs which contain one of these label(s). + any-of-pr-labels: 'needs-rebase' + # Use this to ignore updates such as comments (only to keep the PR alive by bumping) + # ignore-pr-updates: true # Use this to do a dry run from a pull request # debug-only: true From b979bfed9ee53c403f59af5655efd8b439cbea99 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Fri, 22 Nov 2024 18:13:26 +0900 Subject: [PATCH 2/5] Update .github/workflows/close-stale-issues.yml: create issues/PRs section Signed-off-by: Suguru Hirahara --- .github/workflows/close-stale-issues.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 93991b521..44124c2e2 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -15,8 +15,13 @@ jobs: steps: - uses: actions/stale@v9 with: + ###################################################################### + # Issues/PRs + ###################################################################### # An allow-list of label(s) to only process the issues/PRs which contain one of these label(s). any-of-labels: 'needs-info' + # Use this to do a dry run from a pull request + # debug-only: true ###################################################################### # Issues ###################################################################### @@ -41,5 +46,3 @@ jobs: any-of-pr-labels: 'needs-rebase' # Use this to ignore updates such as comments (only to keep the PR alive by bumping) # ignore-pr-updates: true - # Use this to do a dry run from a pull request - # debug-only: true From 94f15c451e11835eeef44bc14bf12784c165c940 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Fri, 22 Nov 2024 18:13:49 +0900 Subject: [PATCH 3/5] Update .github/workflows/close-stale-issues.yml: set exempt-assignees Signed-off-by: Suguru Hirahara --- .github/workflows/close-stale-issues.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 44124c2e2..8e5c045df 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -18,6 +18,7 @@ jobs: ###################################################################### # Issues/PRs ###################################################################### + exempt-assignees: 'spantaleev,aine-etke' # An allow-list of label(s) to only process the issues/PRs which contain one of these label(s). any-of-labels: 'needs-info' # Use this to do a dry run from a pull request From 77ef807c54b8bc63d127e573cfee3ab17f12dda8 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 23 Nov 2024 15:55:38 +0900 Subject: [PATCH 4/5] Update .github/workflows/close-stale-issues.yml: set ignore-pr-updates to true Without this option, stale counters for each PR keep restarting whenever any update occurs or a comment is added to them. Since the counters for PR are set to 365 days, ignore-pr-updates should help us to get rid of zombie PRs (which are kept open by bumps). Signed-off-by: Suguru Hirahara --- .github/workflows/close-stale-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 8e5c045df..88db2d986 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -46,4 +46,4 @@ jobs: # An allow-list of label(s) to only process the PRs which contain one of these label(s). any-of-pr-labels: 'needs-rebase' # Use this to ignore updates such as comments (only to keep the PR alive by bumping) - # ignore-pr-updates: true + ignore-pr-updates: true From ce0036e3963d2ce07d90a9895db3f5e868d8d06a Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 23 Nov 2024 22:31:46 +0900 Subject: [PATCH 5/5] Set operations-per-run to 100 https://github.com/spantaleev/matrix-docker-ansible-deploy/actions/runs/11987582115/job/33421900339?pr=3813 has performed 62 operations, and 100 should be sufficient for a while. Signed-off-by: Suguru Hirahara --- .github/workflows/close-stale-issues.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 88db2d986..45f31da7b 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -1,6 +1,8 @@ --- name: 'Close stale issues and PRs' on: # yamllint disable-line rule:truthy + # Use this to do a dry run from a pull request + # pull_request: schedule: - cron: '30 1 * * *' @@ -19,6 +21,7 @@ jobs: # Issues/PRs ###################################################################### exempt-assignees: 'spantaleev,aine-etke' + operations-per-run: 100 # An allow-list of label(s) to only process the issues/PRs which contain one of these label(s). any-of-labels: 'needs-info' # Use this to do a dry run from a pull request