This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow is used to automaticly close Pull Request and Issues that didn't have any activity on them. | |
# PR and Issues over 90 days will be mark with stale label and after 14 days of no updates will be deleted. | |
name: 'Close stale PRs' | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 1 * * *' | |
permissions: | |
pull-requests: write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def jobname = "the-job-name" | |
def buildnum = 85 | |
def job = Jenkins.instance.getItemByFullName(jobname) | |
for (build in job.builds) { | |
if (buildnum == build.getNumber().toInteger()){ | |
if (build.isBuilding()){ | |
build.doStop(); | |
build.doKill(); | |