From f28a87212246edc481dde11b7ce98a517e55626f Mon Sep 17 00:00:00 2001 From: ramimbo <160272258+ramimbo@users.noreply.github.com> Date: Wed, 20 May 2026 14:36:23 +0000 Subject: [PATCH 1/2] Add contributing guide --- CONTRIBUTING.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6d46808 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,45 @@ +# Contributing + +Keep changes small, plain, and easy to audit. + +## Workflow + +Use pull requests for changes to `main`. + +1. Branch from `main`. +2. Make the smallest change that solves the issue. +3. Update docs when behavior, install steps, privacy, or testing changes. +4. Open a pull request with what changed, why, and how it was tested. + +Avoid unrelated cleanup in feature or bugfix PRs. + +## Code + +- Keep the userscript dependency-free unless there is a strong reason. +- Prefer DOM APIs and text nodes over `innerHTML`. +- Do not add GitHub tokens, background services, analytics, or local activity tracking. +- Treat GitHub selectors as unstable. Keep adapters small and covered by fixtures. +- Sorting should only move loaded timeline activity, not the initial issue or PR post. + +## Testing + +Before opening a PR, run: + +```sh +node --check github-sortout.user.js +npm test +``` + +Run the live smoke checks when touching GitHub page selectors or timeline behavior: + +```sh +npm run test:live +``` + +Manual browser testing is still useful for userscript changes, especially in Firefox with Violentmonkey. + +## Releases + +There is no build step and no automatic update channel. + +For a release, update the userscript version, commit through a pull request, merge to `main`, and install from the raw script URL. From 2ea77bac98b741be4091ce793ec4522a5b55fdd6 Mon Sep 17 00:00:00 2001 From: ramimbo <160272258+ramimbo@users.noreply.github.com> Date: Wed, 20 May 2026 17:45:10 +0300 Subject: [PATCH 2/2] Add CI workflow --- .github/workflows/test.yml | 23 +++++++++++++++++++++++ CONTRIBUTING.md | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..3cdd190 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - run: npm ci + - run: npx playwright install --with-deps chromium + - run: node --check github-sortout.user.js + - run: npm test diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6d46808..4980b96 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,6 +30,8 @@ node --check github-sortout.user.js npm test ``` +CI runs these same non-live checks on pull requests and pushes to `main`. + Run the live smoke checks when touching GitHub page selectors or timeline behavior: ```sh