Skip to content

Commit 4db8ad4

Browse files
committed
Add workflow for testing
1 parent 00a4879 commit 4db8ad4

File tree

2 files changed

+173
-0
lines changed

2 files changed

+173
-0
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
python-checks:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.12"
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install -r requirements.txt
26+
pip install flake8
27+
28+
- name: Syntax check
29+
run: python -m compileall .
30+
31+
- name: Lint with flake8
32+
run: flake8 app.py
33+
34+
docker-build:
35+
runs-on: ubuntu-latest
36+
needs: python-checks
37+
38+
steps:
39+
- name: Check out repository
40+
uses: actions/checkout@v4
41+
42+
- name: Build Docker image
43+
run: docker build . --tag github-notifications-rss:test
44+

README.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# GitHub Notifications RSS
2+
3+
This is a small service that turns your GitHub notifications into an RSS feed.
4+
5+
You give it a GitHub personal access token.
6+
It calls the `/notifications` API, filters the data, and serves a clean RSS 2.0 feed that your reader can subscribe to.
7+
8+
---
9+
10+
## What it does
11+
12+
- Fetches GitHub notifications using the official API
13+
- Can limit to threads where you are actually involved (`participating_only`)
14+
- Can filter by reason (mention, assign, state_change, ci_activity, ...)
15+
- Can include or exclude specific repositories
16+
- Caches results for a short time so it does not hammer the GitHub API
17+
- Exposes two endpoints:
18+
- `/feed` for the RSS feed
19+
- `/health` for a simple JSON status
20+
21+
The RSS items look roughly like this:
22+
23+
- Title: `[owner/repo] Issue or PR title`
24+
- Link: direct link to the issue, pull request, commit or release
25+
- Description: reason, type, repo, unread flag and timestamps
26+
27+
Descriptions can be HTML or plain text, depending on config.
28+
29+
---
30+
31+
## Quick start with Docker
32+
33+
Clone the repo and copy the example env file:
34+
35+
```bash
36+
cp .env.example .env
37+
```
38+
39+
Edit `.env` and set at least:
40+
41+
```env
42+
GITHUB_TOKEN=ghp_your_token_here
43+
```
44+
45+
Then build and start:
46+
47+
```bash
48+
docker compose up --build -d
49+
```
50+
51+
If your compose file maps port `8083:8000`, the feed is available at:
52+
53+
- Feed: `http://localhost:8083/feed`
54+
- Health: `http://localhost:8083/health`
55+
56+
Add `http://localhost:8083/feed` to your RSS reader and you are done.
57+
58+
---
59+
60+
## Token and scopes
61+
62+
You need a GitHub Personal Access Token (classic).
63+
64+
- Only public repositories:
65+
- `public_repo` and `read:user` are usually enough
66+
- With private repositories:
67+
- include `repo`
68+
69+
---
70+
71+
## Basic configuration
72+
73+
Most options are set through environment variables. There is a `.env.example` with all of them. The most useful ones:
74+
75+
```bash
76+
# GitHub access
77+
GITHUB_TOKEN=ghp_your_token_here
78+
GITHUB_API_URL=https://api.github.com
79+
80+
# Query behaviour
81+
GITHUB_NOTIF_PARTICIPATING_ONLY=true
82+
GITHUB_NOTIF_INCLUDE_READ=false
83+
84+
# Optional filters
85+
GITHUB_NOTIF_REASONS_INCLUDE=
86+
GITHUB_NOTIF_REASONS_EXCLUDE=subscribed,ci_activity
87+
GITHUB_NOTIF_REPOS_INCLUDE=
88+
GITHUB_NOTIF_REPOS_EXCLUDE=
89+
90+
# RSS output
91+
RSS_TITLE=GitHub notifications RSS
92+
RSS_LINK=https://github.com/notifications
93+
RSS_DESCRIPTION=Custom feed built from your GitHub notifications
94+
RSS_HTML_DESCRIPTION=true
95+
96+
# Cache
97+
CACHE_TTL_SECONDS=60
98+
99+
# Server
100+
BIND_ADDR=0.0.0.0
101+
BIND_PORT=8000
102+
```
103+
104+
You can tune this later when you know what kind of notifications you want to see or hide. For many people the defaults should be fine.
105+
106+
---
107+
108+
## Status endpoint
109+
110+
The `/health` endpoint returns a small JSON payload, for example:
111+
112+
```json
113+
{
114+
"status": "ok",
115+
"last_fetch": "2025-11-14T06:56:00+00:00",
116+
"last_error": null,
117+
"cache_ttl_seconds": 60
118+
}
119+
```
120+
121+
- `ok` means last fetch worked
122+
- `degraded` means GitHub failed but an older cached feed is still served
123+
- `error` means there is no valid cache and the last fetch failed
124+
125+
---
126+
127+
## License
128+
129+
This project is licensed under the MIT License. See `LICENSE` for details.

0 commit comments

Comments
 (0)