Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lowply/auto-closer
A GitHub Action that closes all issues with a specific label while keeping the latest one(s) open.
https://github.com/lowply/auto-closer
Last synced: 2 months ago
JSON representation
A GitHub Action that closes all issues with a specific label while keeping the latest one(s) open.
- Host: GitHub
- URL: https://github.com/lowply/auto-closer
- Owner: lowply
- Created: 2019-05-13T12:39:29.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-09T02:37:46.000Z (over 3 years ago)
- Last Synced: 2024-10-14T09:18:49.998Z (2 months ago)
- Language: Go
- Size: 11.7 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Auto Closer
This action closes all issues that have a specific label while keeping the latest one(s) open. Works best for daily, weekly or monthly auto created issues (e.g. [lowply/issue-from-template](https://github.com/lowply/issue-from-template/)). Use with care for the initial run especially when you have a large number of open issues with the label.
## Environment variables
- `AC_LABEL` (_required_): The label that the target issue should have.
- `AC_KEEP` (_optional_): The number of the issues should be kept open. Default value: `1`## Workflow example
```
name: weekly report
on:
schedule:
- cron: "0 0 * * 2"
jobs:
open:
name: Open new report issue
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: lowply/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IFT_TEMPLATE_NAME: template.md
close:
needs: open
name: Close old issues
runs-on: ubuntu-latest
steps:
- uses: lowply/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AC_LABEL: "report"
AC_KEEP: 3
```## Running locally for development
This is designed to be used as a GitHub Action, but you can also just build and run it locally with the following env vars:
```
cd src
export GITHUB_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export GITHUB_REPOSITORY="owner/repository"
export AC_LABEL="label"
go run .
```