docs: upstream tracking in README + daily PR mirror (#13)

* docs: replace changelog with upstream divergence table in README

Problem: fork changes were not documented anywhere user-facing. The
auto-generated CHANGELOG.md tracked upstream releases, not fork
divergence.

Solution: delete CHANGELOG.md and add a collapsed <details> block to
README.md with two tables — cherry-picked PRs (by number, with commit
hashes) and triaged upstream issues (by number, with status and
resolution). This gives users a single place to see what the fork
offers over upstream.

* ci: add daily upstream PR mirror workflow

Problem: new upstream PRs required manual monitoring of
stevearc/oil.nvim to discover.

Solution: add a GitHub Actions workflow that runs daily at 08:00 UTC
and creates issues in the fork for any upstream PRs opened in the last
24 hours. Skips dependabot PRs and deduplicates by title prefix.
Issues are labeled upstream/pr for easy filtering.
This commit is contained in:
Barrett Ruth 2026-02-21 15:53:53 -05:00 committed by GitHub
parent fe16993262
commit 1712b6feb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 141 additions and 530 deletions

View file

@ -0,0 +1,85 @@
name: Mirror Upstream PRs
on:
schedule:
- cron: "0 8 * * *"
workflow_dispatch:
permissions:
issues: write
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Mirror new upstream PRs
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const upstream = { owner: 'stevearc', repo: 'oil.nvim' };
const fork = { owner: 'barrettruth', repo: 'oil.nvim' };
const since = new Date();
since.setDate(since.getDate() - 1);
const sinceISO = since.toISOString();
const { data: prs } = await github.rest.pulls.list({
...upstream,
state: 'open',
sort: 'created',
direction: 'desc',
per_page: 30,
});
const recentPRs = prs.filter(pr => {
if (new Date(pr.created_at) < since) return false;
if (pr.user.login === 'dependabot[bot]') return false;
if (pr.user.login === 'dependabot-preview[bot]') return false;
return true;
});
if (recentPRs.length === 0) {
console.log('No new upstream PRs in the last 24 hours.');
return;
}
const { data: existingIssues } = await github.rest.issues.listForRepo({
...fork,
state: 'all',
labels: 'upstream/pr',
per_page: 100,
});
const mirroredNumbers = new Set();
for (const issue of existingIssues) {
const match = issue.title.match(/^upstream#(\d+)/);
if (match) mirroredNumbers.add(parseInt(match[1]));
}
for (const pr of recentPRs) {
if (mirroredNumbers.has(pr.number)) {
console.log(`Skipping PR #${pr.number} — already mirrored.`);
continue;
}
const labels = pr.labels.map(l => l.name).join(', ') || 'none';
await github.rest.issues.create({
...fork,
title: `upstream#${pr.number}: ${pr.title}`,
body: [
`Mirrored from [stevearc/oil.nvim#${pr.number}](${pr.html_url}).`,
'',
`**Author:** @${pr.user.login}`,
`**Labels:** ${labels}`,
`**Created:** ${pr.created_at}`,
'',
'---',
'',
pr.body || '*No description provided.*',
].join('\n'),
labels: ['upstream/pr'],
});
console.log(`Created issue for upstream PR #${pr.number}: ${pr.title}`);
}