use latest commit of stalebot action, tweak configuration accordingly (#41305)

* use latest commit of stalebot action, tweak configuration accordingly

* remove stalebot.js

* use default operations per run

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
This commit is contained in:
Ron Rennick 2023-11-16 11:15:08 -04:00 committed by GitHub
parent 4e383b647b
commit 6402bf8aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 45 deletions

View File

@ -1,29 +0,0 @@
/**
* Set the stalebot start date given a cron schedule.
*/
// You need to install this dependency as part of your workflow.
const core = require( '@actions/core' );
const ScheduleStartDate = () => {
let scheduleStartDate;
switch ( process.env.CRON_SCHEDULE ) {
case '21 1 * * *':
scheduleStartDate = '2022-01-01';
break;
case '31 2 * * *':
scheduleStartDate = '2023-01-01';
break;
case '41 3 * * *':
scheduleStartDate = '2023-08-01';
break;
default:
scheduleStartDate = '2018-01-01';
break;
}
core.setOutput( 'stale-start-date', scheduleStartDate );
};
ScheduleStartDate();

View File

@ -1,10 +1,7 @@
name: 'Process stale needs-feedback issues'
on:
schedule:
- cron: '11 0 * * *'
- cron: '21 1 * * *'
- cron: '31 2 * * *'
- cron: '41 3 * * *'
- cron: '21 * * * *'
permissions: {}
@ -16,25 +13,16 @@ jobs:
issues: write
pull-requests: write
steps:
- name: Install Actions Core
run: npm --prefix .github/workflows/scripts install @actions/core
- name: Get start date
id: startdate
run: node .github/workflows/scripts/stalebot.js
env:
CRON_SCHEDULE: ${{ github.event.schedule }}
- name: Scan issues
uses: actions/stale@v8
uses: actions/stale@b69b346013879cedbf50c69f572cd85439a41936
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
operations-per-run: 8
start-date: steps.startdate.outputs.stale-start-date
stale-issue-message: "As a part of this repository's maintenance, this issue is being marked as stale due to inactivity. Please feel free to comment on it in case we missed something.\n\n###### After 7 days with no activity this issue will be automatically be closed."
close-issue-message: 'This issue was closed because it has been 14 days with no activity.'
days-before-stale: -1
days-before-close: -1
days-before-issue-stale: 7
days-before-issue-close: 7
days-before-pr-close: -1
stale-issue-label: 'status: stale'
stale-pr-label: 'status: stale'
exempt-issue-labels: 'type: enhancement'

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
use latest commit of stalebot action, tweak configuration accordingly