From 6402bf8aa32f047d060c568706cf0494ef579457 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Thu, 16 Nov 2023 11:15:08 -0400 Subject: [PATCH] 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 --- .github/workflows/scripts/stalebot.js | 29 ------------------- .github/workflows/stalebot.yml | 20 +++---------- .../changelog/update-stalebot-action | 4 +++ 3 files changed, 8 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/scripts/stalebot.js create mode 100644 plugins/woocommerce/changelog/update-stalebot-action diff --git a/.github/workflows/scripts/stalebot.js b/.github/workflows/scripts/stalebot.js deleted file mode 100644 index 83b28292d49..00000000000 --- a/.github/workflows/scripts/stalebot.js +++ /dev/null @@ -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(); diff --git a/.github/workflows/stalebot.yml b/.github/workflows/stalebot.yml index 719213623f1..84093a63f8a 100644 --- a/.github/workflows/stalebot.yml +++ b/.github/workflows/stalebot.yml @@ -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' diff --git a/plugins/woocommerce/changelog/update-stalebot-action b/plugins/woocommerce/changelog/update-stalebot-action new file mode 100644 index 00000000000..ac35b9b9a23 --- /dev/null +++ b/plugins/woocommerce/changelog/update-stalebot-action @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +use latest commit of stalebot action, tweak configuration accordingly