Skip to content

Instantly share code, notes, and snippets.

View orenzi-tr's full-sized avatar

Oren Zipori orenzi-tr

  • eToro
  • Israel
View GitHub Profile
@orenzi-tr
orenzi-tr / stale.yaml
Created July 4, 2021 16:14
This Gist is a template for creating a simple Github aciton for cleaning up stale commits.
# 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
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();