Skip to content

fix(github): fix issue templates, auto-labeling, and moderator workflows - #2944

Open
7ui77 wants to merge 9 commits into
lnreader:masterfrom
7ui77:fix/issue-templates-and-label-workflows
Open

7ui77 wants to merge 9 commits into
lnreader:masterfrom
7ui77:fix/issue-templates-and-label-workflows

Conversation

@7ui77

@7ui77 7ui77 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Checklist

  • Update version code if an existing plugin was modified (N/A — workflow, issue template, and dev tooling changes only)
  • Test changes in Plugin Playground or the app (verified via pnpm run test:scripts [31/31], CLI smoke tests, ESLint/Prettier, Python YAML/schema validation, and actionlint v1.7.12)
  • Reference related issues in the PR body (proactive maintenance audit; fixes root causes observed on e.g. NovelBuddy JSON Parse error #2296, 69shuba(chinese) #1866)
  • Commit messages follow type(scope): description

Summary

.github/
├── scripts/
│   ├── issue-parsing.cjs                  # shared heading, severity, normalization & buildSelectionMatcher helpers
│   ├── auto-label-issue.cjs               # 50-char label truncation, add/remove reconciliation, expanded languages
│   ├── auto-label-issue.test.cjs          # 16 unit tests (50-char invariant, CJK/Arabic, reconciliation, CLI, renderer)
│   ├── validate-issue-template.cjs        # validates Report Issue / Request Plugin / Request Feature forms & Acknowledgements
│   ├── validate-issue-template.test.cjs   # 15 unit tests (valid/invalid forms, headings in textareas, checkboxes, exemptions, CLI, YAML drift guard)
│   ├── generate-issue-index.cjs           # reuses issue-parsing.cjs & buildSelectionMatcher
│   ├── generate-issue-index.test.cjs      # 2 unit tests for full & incremental index updates
│   ├── generate-issue-template-options.cjs# exports renderIssueTemplate; guards main() behind require.main
│   └── blank_report_issue.yml             # placeholder 2.1.4 + latest release link
├── ISSUE_TEMPLATE/
│   └── request_feature.yml                # removes stale 1.1.19 version link -> releases/latest
└── workflows/
    ├── issue_auto_label.yml               # triggers on opened/edited/labeled; syncs add/remove labels via API
    ├── theme_auto_label.yml               # single-step Content-Type + temp-file grep probes, readwn, lightnovelwp fallback, private-IP redirect guard
    ├── issue_moderator.yml                # template validation auto-close on opened + SHA-pinned moderator action + gated index dispatch
    ├── generate-issue-index.yml           # watches issue-parsing.cjs
    └── github-scripts-check.yml           # PR CI: script tests + clean-tree guard, ESLint/Prettier, YAML/schema, actionlint
package.json                               # adds test:scripts; adds cjs/mjs to lint-staged
AGENTS.md                                  # adds .github/scripts pointer & sharpens CODING_STANDARDS trigger

Key fixes:

  • Stop spawning bare plugin: labels, fix CJK/Arabic matching & enforce GitHub 50-char limit: auto-label-issue.cjs shares buildSelectionMatcher via issue-parsing.cjs (handling \u200e LRM Arabic controls, comma-containing Chinese/Korean prefixes, and colons inside names like Re:Library), truncates long plugin labels to <= 50 chars while preserving [cleanId] for generate-issue-index.cjs (preventing batch API 422 errors across all 374 keys.json entries), and computes { add, remove } reconciliation (computeLabelPlan) on opened, edited, and labeled.
  • Enable language: auto-labeling on plugin requests: expands LANGUAGE_ALIASES (+10 languages + delimited primary language parsing), preserves manually added unlisted language: * labels via MANAGED_LANGUAGE_LABELS, and safely pre-creates missing language: * labels with #ADD8E6.
  • Theme auto-labeler hardening: consolidates the 6 probes (madara, lightnovelwp with legacy lighnovelwp fallback, hotnovelpub, fictioneer, novel fire, readwn) behind a shared probe helper, fixes pipefail/SIGPIPE false negatives on large HTML pages by downloading to "$RUNNER_TEMP" before grep -q, validates http_code == 200 + Content-Type (text/css/javascript) to reject soft-404 redirects, strips scheme case-insensitively while rejecting local/private domains and private/loopback %{remote_ip} redirect targets, and gates labeled runs on plugin request (plus edited).
  • Template-aware auto-close & moderator cleanup: replaces obsolete Markdown auto-close-rules and non-existent do-not-autoclose in issue_moderator.yml with validate-issue-template.cjs on issues.opened (auto-closing non-template, blank, _No response_-filled, or unchecked-Acknowledgements issues as not_planned with the invalid label and an explanatory comment linking to /issues/new/choose, while exempting OWNER/MEMBER/COLLABORATOR/Bot and preserving Markdown headings inside required textareas), pins tachiyomiorg/issue-moderator-action@32a31ab12ad6e68ebf4c65408f47bef132d4fd3c # v2, gates generate-issue-index.yml dispatches on actual post-moderation state/labels changes, and updates blank_report_issue.yml / request_feature.yml to releases/latest (leaving generated report_issue.yml untouched per CODING_STANDARDS.md).
  • Hardened .github/ CI (github-scripts-check.yml): triggers on PRs without a workflow-level paths: filter (safe as a Required Status Check via an in-job fetch-depth: 2 .github/ diff gate), enforces clean-tree after node --test, Prettier + ESLint (--max-warnings 0) on .github/scripts/*.cjs, Python UniqueKeyLoader + Issue Form schema validation on renderIssueTemplate(blank_report_issue.yml, keys.json), direct report_issue.yml PR-edit guard, and SHA-256-verified actionlint v1.7.12 across all workflows.

Evidence

  • pnpm run test:scripts (node --test .github/scripts/*.test.cjs): 31/31 passing (16 auto-label/index/template tests + 15 template-validation & YAML schema drift-guard tests)
  • ./node_modules/.bin/prettier --check ".github/scripts/*.cjs" & ./node_modules/.bin/eslint --max-warnings 0 ".github/scripts/*.cjs": 0 errors, 0 warnings
  • Python UniqueKeyLoader + Issue Form schema validation (15/15 static YAML files locally; CI validates 16/16 including rendered blank_report_issue.yml + keys.json)
  • actionlint v1.7.12 across all .github/workflows/*.yml (including publish-plugins.yml with targeted SC2086:info:1:29 ignore): 0 errors, 0 warnings

Merge Danger

Door: Two-way

Only .github/ workflows, templates, package.json, and AGENTS.md are modified; no plugin source files, built manifests, .husky/pre-commit, or generated report_issue.yml are touched. theme_auto_label.yml checks for theme: lightnovelwp and falls back to theme: lighnovelwp if present, avoiding duplicate label creation on merge.

Blast Radius: Narrow

Limited to GitHub issue/PR automation and local test/lint scripts.

Optional maintainer GitHub UI cleanup after merge:

  • Delete the stray empty plugin: label.
  • Rename theme: lighnovelwp -> theme: lightnovelwp.

AI-assisted (Antigravity / Gemini).

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Confidence Score: 4/5 · Fetch the current issue before automatic closing; otherwise, an author’s corrected issue can still be closed.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect issue handling and GitHub checks in this repository.

Fetch the current issue before automatic closing; otherwise, an author’s corrected issue can still be closed.

Findings

  1. P1 Fixed issues get closed ▶

Summary

This PR updates issue forms, label automation, moderator checks, and GitHub workflow checks.

  • Issue labels now follow the answers and changes on each issue.
  • Edited plugin requests can get a theme label after a fresh website check.
  • New issues are checked against their form before moderator actions run.
  • Pull requests that change GitHub tooling now run script and template checks.

Reviews (3) · Last reviewed commit: "fix(github): address code review finding..." · Reviewed by Greptile

Comment on lines +52 to +58
node .github/scripts/validate-issue-template.cjs > "$RUNNER_TEMP/template-check.json"
if [ "$(jq -r '.shouldClose' "$RUNNER_TEMP/template-check.json")" = "true" ]; then
jq -n '{labels: ["invalid"]}' \
| gh api --method POST "repos/$REPOSITORY/issues/$ISSUE_NUMBER/labels" --input - >/dev/null
jq '{body: .comment}' "$RUNNER_TEMP/template-check.json" \
| gh api --method POST "repos/$REPOSITORY/issues/$ISSUE_NUMBER/comments" --input - >/dev/null
gh api --method PATCH "repos/$REPOSITORY/issues/$ISSUE_NUMBER" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Fixed issues get closed

If an author fixes missing information while this job waits or starts up, the close decision still uses the original opened event. The workflow adds invalid, posts a comment, and closes the now-valid issue. Later edited runs skip validation and cannot undo this. Fetch the current issue body, labels, and state before deciding to close it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant