Skip to content

Commit

Permalink
Enable live runs of repo maintenence job via manual trigger (#1300)
Browse files Browse the repository at this point in the history
* Enable live runs of repo maintenence job via manual trigger

* Allow config options to be set on manual runs of job
  • Loading branch information
javulticat committed Apr 3, 2024
1 parent 4a24cb6 commit 047c9a8
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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 }}

0 comments on commit 047c9a8

Please sign in to comment.