fix(issue-form): list published releases only, drop TestFlight draft entries

Per maintainer feedback (fredrikburmester, lancechant): the version dropdown
no longer surfaces draft releases as "X (TestFlight)" — drafts and prereleases
are unreliable version identifiers. update-issue-form.mjs now fetches only
published, non-prerelease releases and drops the per-version TestFlight label;
the workflow triggers on `released` events only; and the generic
"TestFlight/Development build" sentinel is restored at the end of the list.
This commit is contained in:
Gauvino
2026-06-05 13:30:47 +02:00
parent 3c8369ea4d
commit 55376cd824
3 changed files with 16 additions and 21 deletions

View File

@@ -77,12 +77,13 @@ body:
label: Streamyfin Version label: Streamyfin Version
description: What version of Streamyfin are you running? description: What version of Streamyfin are you running?
options: options:
- 0.54.1 (TestFlight) - 0.54.1
- 0.51.0 - 0.51.0
- 0.47.1 - 0.47.1
- 0.30.2 - 0.30.2
- 0.28.0 - 0.28.0
- older - older
- TestFlight/Development build
validations: validations:
required: true required: true

View File

@@ -2,9 +2,8 @@ name: 🐛 Update Issue Form Versions
on: on:
release: release:
# Also fire on drafts/prereleases so versions that aren't a full release yet # Only full releases populate the dropdown (no drafts/prereleases).
# (TestFlight / dev builds) still land in the dropdown. types: [released]
types: [published, released, prereleased, created, deleted]
schedule: schedule:
- cron: "0 3 * * 1" # Weekly safety net (Mondays 03:00 UTC) in case a release event was missed - cron: "0 3 * * 1" # Weekly safety net (Mondays 03:00 UTC) in case a release event was missed
workflow_dispatch: workflow_dispatch:
@@ -56,7 +55,7 @@ jobs:
## 📝 Description ## 📝 Description
Automated update of the **Streamyfin Version** dropdown in `.github/ISSUE_TEMPLATE/issue_report.yml`, populated from the latest GitHub releases by `scripts/update-issue-form.mjs` (draft releases shown as `X (TestFlight)`). Automated update of the **Streamyfin Version** dropdown in `.github/ISSUE_TEMPLATE/issue_report.yml`, populated from the latest published GitHub releases by `scripts/update-issue-form.mjs`.
**Version dropdown now lists:** ${{ steps.populate.outputs.versions }} **Version dropdown now lists:** ${{ steps.populate.outputs.versions }}

View File

@@ -4,10 +4,9 @@
* latest GitHub releases. Run by the "Update Issue Form Versions" workflow on * latest GitHub releases. Run by the "Update Issue Form Versions" workflow on
* release events + a weekly cron (and manually via workflow_dispatch). * release events + a weekly cron (and manually via workflow_dispatch).
* *
* Source: GitHub releases, newest first, INCLUDING drafts and prereleases — those * Source: published, non-draft, non-prerelease GitHub releases, newest first.
* are the builds release.yml pushes to TestFlight (iOS) / beta (Android), and the * Non-version sentinels (e.g. "older", "TestFlight/Development build") are
* app shows that same version to users. Draft releases are labelled "X (TestFlight)". * preserved at the end of the list.
* Non-version sentinels (e.g. "older") are preserved at the end of the list.
* *
* Usage: * Usage:
* bun scripts/update-issue-form.mjs # rewrite the form in place * bun scripts/update-issue-form.mjs # rewrite the form in place
@@ -35,10 +34,8 @@ const DRY = process.argv.includes("--dry-run");
// Matches "0.54.1" and prerelease/beta tags like "0.54.0-beta.1". // Matches "0.54.1" and prerelease/beta tags like "0.54.0-beta.1".
const isVersion = (s) => /^\d+\.\d+/.test(s.trim()); const isVersion = (s) => /^\d+\.\d+/.test(s.trim());
// 1. Fetch releases (newest first) with their draft flag. Drafts are the builds pushed // 1. Fetch published releases (newest first), excluding drafts and prereleases —
// to TestFlight (iOS) / beta (Android) by release.yml, so they aren't a full release // those aren't a full release users run, so they don't belong in the dropdown.
// yet — we label those "X (TestFlight)". (Listing drafts needs the token to have repo
// write access, which the workflow grants.)
const raw = execFileSync( const raw = execFileSync(
"gh", "gh",
[ [
@@ -46,19 +43,18 @@ const raw = execFileSync(
`repos/${REPO}/releases`, `repos/${REPO}/releases`,
"--paginate", "--paginate",
"--jq", "--jq",
".[] | [.tag_name, .draft] | @tsv", ".[] | select(.draft == false and .prerelease == false) | .tag_name",
], ],
{ encoding: "utf8" }, { encoding: "utf8" },
); );
const seen = new Set(); const seen = new Set();
const versions = []; const versions = [];
for (const line of raw.split("\n")) { for (const tag of raw.split("\n")) {
const [tag, draft] = line.split("\t");
if (!tag) continue; if (!tag) continue;
const ver = tag.trim().replace(/^v/, ""); const ver = tag.trim().replace(/^v/, "");
if (!isVersion(ver) || seen.has(ver)) continue; if (!isVersion(ver) || seen.has(ver)) continue;
seen.add(ver); seen.add(ver);
versions.push(draft === "true" ? `${ver} (TestFlight)` : ver); versions.push(ver);
if (versions.length >= LIMIT) break; if (versions.length >= LIMIT) break;
} }
@@ -67,9 +63,8 @@ if (!versions.length) {
process.exit(1); process.exit(1);
} }
// 2. rewrite the dropdown options, preserving non-version sentinels (e.g. "older"). // 2. rewrite the dropdown options, preserving non-version sentinels
// The old generic "TestFlight/Development build" entry is dropped — TestFlight // (e.g. "older", "TestFlight/Development build") at the end of the list.
// versions are now shown individually as "X (TestFlight)".
const lines = read(FORM, "utf8").split("\n"); const lines = read(FORM, "utf8").split("\n");
const idIdx = lines.findIndex((l) => const idIdx = lines.findIndex((l) =>
l.match(new RegExp(`^\\s*id:\\s*${DROPDOWN_ID}\\s*$`)), l.match(new RegExp(`^\\s*id:\\s*${DROPDOWN_ID}\\s*$`)),
@@ -87,7 +82,7 @@ let end = optIdx + 1;
const sentinels = []; const sentinels = [];
while (end < lines.length && /^\s*-\s+/.test(lines[end])) { while (end < lines.length && /^\s*-\s+/.test(lines[end])) {
const val = lines[end].replace(/^\s*-\s+/, ""); const val = lines[end].replace(/^\s*-\s+/, "");
if (!isVersion(val) && !/testflight/i.test(val)) sentinels.push(val); if (!isVersion(val)) sentinels.push(val);
end++; end++;
} }