Skip to content

Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.

fix(ci): replace unresolvable action with github-script and update composite id assertion

Samir Hossains3847cd7529f4
diff --git a/.github/workflows/duplicate-detector.yml b/.github/workflows/duplicate-detector.yml
index 2e4f11b..138e0ac 100644
--- a/.github/workflows/duplicate-detector.yml
+++ b/.github/workflows/duplicate-detector.yml
@@ -13,12 +13,38 @@ jobs:
if: "!github.event.issue.pull_request"
steps:
- name: Check issue similarity
- uses: actions-cool/issues-similarity@v1
+ uses: actions/github-script@v7
with:
- filter-threshold: 0.75
- title-threshold: 0.85
- comment: |
- Potential duplicate detected: #{number}.
+ script: |
+ const currentIssue = context.payload.issue;
+ const currentTitle = currentIssue.title.toLowerCase().replace(/^(bug|feat|chore|docs|fix):\s*/, '').trim();
+ if (currentTitle.length < 5) return;
- Check that issue to see if this has already been reported or resolved.
- close-issue: false
+ const words = currentTitle.split(/\s+/).filter(w => w.length > 3);
+ if (words.length === 0) return;
+
+ const issues = await github.paginate(github.rest.issues.listForRepo, {
+ ...context.repo,
+ state: 'all',
+ per_page: 100,
+ });
+
+ for (const issue of issues) {
+ if (issue.number === currentIssue.number || issue.pull_request) continue;
+ const otherTitle = issue.title.toLowerCase().replace(/^(bug|feat|chore|docs|fix):\s*/, '').trim();
+
+ let matches = 0;
+ for (const word of words) {
+ if (otherTitle.includes(word)) matches++;
+ }
+
+ const score = matches / words.length;
+ if (score >= 0.75) {
+ await github.rest.issues.createComment({
+ ...context.repo,
+ issue_number: currentIssue.number,
+ body: `Potential duplicate detected: #${issue.number} (${issue.title}).\n\nCheck that issue to see if this has already been reported or resolved.`
+ });
+ break;
+ }
+ }
diff --git a/tests/addons_manifest.rs b/tests/addons_manifest.rs
index 052faf5..2fc8f20 100644
--- a/tests/addons_manifest.rs
+++ b/tests/addons_manifest.rs
@@ -66,7 +66,7 @@ fn test_addon_series_classification_and_default_season_structure() {
};
let details = meta_detail_to_media_details(&off_campus_series);
- assert_eq!(details.id.value, "tt32034988");
+ assert_eq!(details.id.value, "series:tt32034988");
assert_eq!(details.title, "Off Campus");
assert_eq!(details.media_type, MediaType::Series);
assert_eq!(details.year.as_deref(), Some("2026"));