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
description: What version of Streamyfin are you running?
options:
- 0.54.1 (TestFlight)
- 0.54.1
- 0.51.0
- 0.47.1
- 0.30.2
- 0.28.0
- older
- TestFlight/Development build
validations:
required: true

View File

@@ -2,9 +2,8 @@ name: 🐛 Update Issue Form Versions
on:
release:
# Also fire on drafts/prereleases so versions that aren't a full release yet
# (TestFlight / dev builds) still land in the dropdown.
types: [published, released, prereleased, created, deleted]
# Only full releases populate the dropdown (no drafts/prereleases).
types: [released]
schedule:
- cron: "0 3 * * 1" # Weekly safety net (Mondays 03:00 UTC) in case a release event was missed
workflow_dispatch:
@@ -56,7 +55,7 @@ jobs:
## 📝 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 }}

View File

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