Skip to content

cargomedia/cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delete Old Issues

Deletes old closed issues that had no activity for a specified amount of time

List of options

Input Description
repository-token Personal Access Token for authorizing repository
repository-name Name of the repository
repository-owner Owner of the repository
days-before-deletion (Optional) Idle number of days before deleting a closed issue.
Defaults to 365.
dry-run (Optional) Run the action in dry-run mode without actually deleting any issue.
Defaults to false.

Usage

Basic:

name: 'Delete old issues'
on:
  schedule:
    - cron: '30 9 * * 1'

jobs:
  cleaner:
    runs-on: ubuntu-latest
    steps:
      - uses: cargomedia/cleaner@v1.0.0
        with:
          repository-token: ${{ secrets.PERSONAL_TOKEN }}
          repository-name: 'foo'
          repository-owner: 'bar'

Configure idle number of days before deletion:

name: 'Delete old issues'
on:
  schedule:
    - cron: '30 9 * * 1'

jobs:
  cleaner:
    runs-on: ubuntu-latest
    steps:
      - uses: cargomedia/cleaner@v1.0.0
        with:
          repository-token: ${{ secrets.PERSONAL_TOKEN }}
          repository-name: 'foo'
          repository-owner: 'bar'
          days-before-deletion: 42

Dry-run to check what issues would be deleted without actually deleting them:

name: 'Delete old issues'
on:
  schedule:
    - cron: '30 9 * * 1'

jobs:
  cleaner:
    runs-on: ubuntu-latest
    steps:
      - uses: cargomedia/cleaner@v1.0.0
        with:
          repository-token: ${{ secrets.PERSONAL_TOKEN }}
          repository-name: 'foo'
          repository-owner: 'bar'
          dry-run: true

Personal Access Token

In order to delete issues the Admin permission is required. As {{ secrets.GITHUB_TOKEN }} has only write permission on issues it is needed to create a Personal Access Token with scope repo and add it as secret in your workflow's repository so it can be used in the action.

About

GitHub Action: Deletes old closed issues that had no activity for a specified amount of time

Resources

License

Stars

Watchers

Forks

Packages

No packages published