Two contributors in one week sent solid PRs against the retired Tauri/Svelte tree (#561, #564) because nothing in the repo says it is dead. Three zero-risk notices, no code touched: a pull_request_target bot that leaves one sticky comment when a PR touches src//src-tauri/ (target on purpose — fork PRs cannot be commented under plain pull_request; the PR code is never checked out), sentinel READMEs at both tree roots (what GitHub renders when browsing), and a PR template checkbox. The tree deletion + local reference worktree is the 2.0.2 follow-up (owner hold: no dependency risk allowed before 2.0.1). cc
57 lines
2.6 KiB
YAML
57 lines
2.6 KiB
YAML
name: legacy-tree-notice
|
|
|
|
# The Tauri/Svelte frontend (src/, src-tauri/) is RETIRED — kept in-tree only
|
|
# as the 1:1 port reference until the 2.x cleanup removes it. Contributors
|
|
# keep sending PRs against it (#561, #564), so this bot leaves one sticky
|
|
# comment when a PR touches those paths. pull_request_target ON PURPOSE:
|
|
# fork PRs get a read-only token under plain pull_request and could not be
|
|
# commented on. Safe: the PR's code is NEVER checked out or executed here —
|
|
# we only read the changed-file list and post a comment.
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, synchronize]
|
|
|
|
permissions:
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
notice:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Comment when the PR touches the legacy tree
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const files = await github.paginate(github.rest.pulls.listFiles, {
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
pull_number: context.payload.pull_request.number,
|
|
per_page: 100,
|
|
});
|
|
const legacy = files.filter(f =>
|
|
f.filename.startsWith('src/') || f.filename.startsWith('src-tauri/'));
|
|
if (legacy.length === 0) return;
|
|
const marker = '<!-- legacy-tree-notice -->';
|
|
const comments = await github.paginate(github.rest.issues.listComments, {
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.payload.pull_request.number,
|
|
per_page: 100,
|
|
});
|
|
if (comments.some(c => c.body && c.body.includes(marker))) return;
|
|
const body = [
|
|
marker,
|
|
'Hi! Thanks a lot for contributing.',
|
|
'',
|
|
'Heads up: this change touches `src/` / `src-tauri/`, which is the **retired Tauri/Svelte frontend**. Since 2.0 the app that actually ships is the native Slint UI under `crates/` — the old tree stays in the repo only as a porting reference and will be deleted soon.',
|
|
'',
|
|
'Your analysis is still valuable! If the bug/feature also applies to the live app, we are happy to help port it — recent examples: #561 (Dutch translation) and #564 (favorite sync) were both re-implemented in `crates/` with credit to their authors.',
|
|
].join('\n');
|
|
await github.rest.issues.createComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.payload.pull_request.number,
|
|
body,
|
|
});
|