Skip to content

Commit d7a0c85

Browse files
authored
Add contributing guide and CI
Add contribution guidelines and a GitHub Actions CI workflow for syntax and Playwright fixture tests.
1 parent a2e85d5 commit d7a0c85

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
cache: npm
19+
20+
- run: npm ci
21+
- run: npx playwright install --with-deps chromium
22+
- run: node --check github-sortout.user.js
23+
- run: npm test

CONTRIBUTING.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Contributing
2+
3+
Keep changes small, plain, and easy to audit.
4+
5+
## Workflow
6+
7+
Use pull requests for changes to `main`.
8+
9+
1. Branch from `main`.
10+
2. Make the smallest change that solves the issue.
11+
3. Update docs when behavior, install steps, privacy, or testing changes.
12+
4. Open a pull request with what changed, why, and how it was tested.
13+
14+
Avoid unrelated cleanup in feature or bugfix PRs.
15+
16+
## Code
17+
18+
- Keep the userscript dependency-free unless there is a strong reason.
19+
- Prefer DOM APIs and text nodes over `innerHTML`.
20+
- Do not add GitHub tokens, background services, analytics, or local activity tracking.
21+
- Treat GitHub selectors as unstable. Keep adapters small and covered by fixtures.
22+
- Sorting should only move loaded timeline activity, not the initial issue or PR post.
23+
24+
## Testing
25+
26+
Before opening a PR, run:
27+
28+
```sh
29+
node --check github-sortout.user.js
30+
npm test
31+
```
32+
33+
CI runs these same non-live checks on pull requests and pushes to `main`.
34+
35+
Run the live smoke checks when touching GitHub page selectors or timeline behavior:
36+
37+
```sh
38+
npm run test:live
39+
```
40+
41+
Manual browser testing is still useful for userscript changes, especially in Firefox with Violentmonkey.
42+
43+
## Releases
44+
45+
There is no build step and no automatic update channel.
46+
47+
For a release, update the userscript version, commit through a pull request, merge to `main`, and install from the raw script URL.

0 commit comments

Comments
 (0)