Skip to content

Instantly share code, notes, and snippets.

@orenzi-tr
Created July 4, 2021 16:14
Show Gist options
  • Save orenzi-tr/b8c6bf23338d1d1fadaa660750db1bb6 to your computer and use it in GitHub Desktop.
Save orenzi-tr/b8c6bf23338d1d1fadaa660750db1bb6 to your computer and use it in GitHub Desktop.
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
issues: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
stale-issue-message: 'This issue didnt have any activity for the last 90 days, in 14 days it will be deleted'
stale-pr-message: 'This pull request didnt have any activity for the last 90 days, in 14 days it will be deleted'
days-before-stale: 60
days-before-close: 14
delete-branch: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment