ci: add dry-run option to stale PR closer workflow
Allows testing stale PR closure without actually closing PRs
This commit is contained in:
7
.github/workflows/close-stale-prs.yml
vendored
7
.github/workflows/close-stale-prs.yml
vendored
@@ -2,6 +2,11 @@ name: Close stale PRs
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
dryRun:
|
||||||
|
description: "Log actions without closing PRs"
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 6 * * *"
|
- cron: "0 6 * * *"
|
||||||
|
|
||||||
@@ -22,7 +27,7 @@ jobs:
|
|||||||
const DAYS_INACTIVE = 60
|
const DAYS_INACTIVE = 60
|
||||||
const cutoff = new Date(Date.now() - DAYS_INACTIVE * 24 * 60 * 60 * 1000)
|
const cutoff = new Date(Date.now() - DAYS_INACTIVE * 24 * 60 * 60 * 1000)
|
||||||
const { owner, repo } = context.repo
|
const { owner, repo } = context.repo
|
||||||
const dryRun = false
|
const dryRun = context.payload.inputs?.dryRun === "true"
|
||||||
const stalePrs = []
|
const stalePrs = []
|
||||||
|
|
||||||
core.info(`Dry run mode: ${dryRun}`)
|
core.info(`Dry run mode: ${dryRun}`)
|
||||||
|
|||||||
Reference in New Issue
Block a user