Automatically mark pull requests and issues as stale with GitHub Actions
Source: Dev.to
Oh no, stale things!
You don’t want old pull requests and issues to clog the backlog of your open‑source projects, no matter how big or small. I ran into this problem recently: people left partially completed PRs and drafts on my repo. While I appreciate the effort, I don’t want to keep an eye on items that will never be picked up again, nor remember to close them over time.
There has to be a better way!
There is! There’s a handy GitHub Action called stale that you can add to your repositories.
- In your repository, open the
.github/folder. - Create a subfolder named
workflows. - Add the Action’s
.ymlfile to that folder.
That’s it!
For more details on adding Actions, see the official documentation: Adding Actions.
If you’d like to see a concrete implementation, check out the example in my PocketCal app repository: stale.yml.