JoshuaKGoldberg / JoshuaKGoldberg/prune-github-notifications

📝 Documentation: Github Workflow Documentation

Open
#198 2 comments 0 reactions 0 assignees View on GitHub
area: documentation status: accepting prs
Dominant language
TypeScript
Stars
7
Forks
0
Avg merge
12m
Merged PRs (30d)
35

Description

### Bug Report Checklist

- [X] I have pulled the latest `main` branch of the repository.
- [X] I have [searched for related issues](https://github.com/JoshuaKGoldberg/prune-github-notifications/issues?q=is%3Aissue) and found none that matched my issue.

### Overview

I think it'd be cool to show how to use a github workflow to automate this.

I'm not sure you can create fine-grained access tokens for notifications though, so this could be issue (having your whole team's PATs on a server is not good)

Here's an action I wrote to help myself:

```yml
name: Prune seveibar GitHub Notifications

on:
schedule:
- cron: '*/10 * * * *' # Runs every 10 minutes
workflow_dispatch: # Allows manual triggering

jobs:
prune-notifications:
runs-on: ubuntu-latest

steps:
- name: Setup Bun Runtime
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install Prune Notifications Tool
run: bun install --global @seveibar/prune-github-notifications

- name: Prune Bot Notifications
env:
GH_TOKEN: ${{ secrets.SEVEIBAR_GH_TOKEN }}
run: prune-github-notifications --botAuthors --title ".*" --reason any

- name: Prune Dependency Update Notifications
env:
GH_TOKEN: ${{ secrets.SEVEIBAR_GH_TOKEN }}
run: prune-github-notifications --reason any --title ".*update dependency.*"
```

![image](https://github.com/user-attachments/assets/d0e28d44-e0e0-47e2-8724-f8dec2b2ed97)

### Additional Info

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.