From 047c9a8c1d76080cf99540b2ea7d5d3ac7edf172 Mon Sep 17 00:00:00 2001 From: javulticat Date: Wed, 3 Apr 2024 13:44:08 +0000 Subject: [PATCH] Enable live runs of repo maintenence job via manual trigger (#1300) * Enable live runs of repo maintenence job via manual trigger * Allow config options to be set on manual runs of job --- .github/workflows/maintenance.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml index 7786ecb16..d36df2096 100644 --- a/.github/workflows/maintenance.yml +++ b/.github/workflows/maintenance.yml @@ -2,8 +2,17 @@ name: Perform automated repository maintenance on: workflow_dispatch: - schedule: - - cron: "0 */2 * * *" + inputs: + dry-run: + description: "Dry-run" + type: boolean + operations: + description: "Max number of operations per run" + type: number +# Out of an abundance of caution, disabling automatic execution for now +# TODO: Reschedule job once expected behavior is consistently observed +# schedule: +# - cron: "0 */2 * * *" jobs: cleanup-inactive: @@ -17,6 +26,7 @@ jobs: total_days: 100 inactive_label: "no-activity" closed_label: "auto-closed" + default_operations: ${{ inputs.dry-run && 1000 || 30 }} steps: - name: Cleanup inactive issues/PRs uses: actions/stale@v9 @@ -36,6 +46,6 @@ jobs: labels-to-add-when-unstale: "needs-review" ascending: true enable-statistics: true - # DEBUG OPTIONS - debug-only: true - operations-per-run: 1000 + # CONFIG OPTIONS + debug-only: ${{ inputs.dry-run }} + operations-per-run: ${{ inputs.operations || env.default_operations }}