Deletes old closed issues that had no activity for a specified amount of time
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. |
Basic:
name: 'Delete old issues'
on:
schedule:
- cron: '30 9 * * 1'
jobs:
cleaner:
runs-on: ubuntu-latest
steps:
- uses: cargomedia/[email protected]
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/[email protected]
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/[email protected]
with:
repository-token: ${{ secrets.PERSONAL_TOKEN }}
repository-name: 'foo'
repository-owner: 'bar'
dry-run: true
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.