mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-11 00:10:24 +01:00
- `release` events check out the tagged commit, so the script regenerated the form from the tag's stale copy and the bot PR could revert form edits made on develop since that release - checkout develop explicitly. - Fixed concurrency group: a release event and the weekly cron no longer race on the same ci/update-issue-form branch (queue, no cancel). - Replace `gh api --paginate` (fetches every release page) with `gh release list --exclude-drafts --exclude-pre-releases --limit N`. - Document the GITHUB_TOKEN limitation on the auto-merge step: bot PRs don't trigger required checks; close/reopen kicks them, then auto-merge completes after reviews.
103 lines
4.3 KiB
YAML
103 lines
4.3 KiB
YAML
name: 🐛 Update Issue Form Versions
|
||
|
||
on:
|
||
release:
|
||
# 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:
|
||
|
||
# Fixed group so a release event and the weekly cron can't race on the same
|
||
# ci/update-issue-form branch — runs queue instead of force-pushing over each other.
|
||
concurrency:
|
||
group: update-issue-form
|
||
cancel-in-progress: false
|
||
|
||
permissions:
|
||
contents: read
|
||
|
||
jobs:
|
||
update-issue-form:
|
||
name: 🔢 Populate version dropdown
|
||
runs-on: ubuntu-24.04
|
||
permissions:
|
||
contents: write
|
||
pull-requests: write
|
||
steps:
|
||
- name: 📥 Checkout repository
|
||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||
with:
|
||
# On `release` events GITHUB_SHA is the tagged commit — without this the
|
||
# script would regenerate the form from the tag's (stale) copy and the bot
|
||
# PR would revert any form edits made on develop since that release.
|
||
ref: develop
|
||
|
||
- name: 🍞 Setup Bun
|
||
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
||
with:
|
||
bun-version: latest
|
||
|
||
- name: 🔢 Populate version dropdown from GitHub releases
|
||
id: populate
|
||
run: bun scripts/update-issue-form.mjs
|
||
env:
|
||
GH_TOKEN: ${{ github.token }}
|
||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||
|
||
- name: 📬 Create pull request
|
||
id: cpr
|
||
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
||
with:
|
||
add-paths: .github/ISSUE_TEMPLATE/issue_report.yml
|
||
branch: ci/update-issue-form
|
||
base: develop
|
||
delete-branch: true
|
||
labels: ⚙️ ci, 🤖 github-actions
|
||
commit-message: "chore: update issue form version dropdown"
|
||
title: "chore: update issue form version dropdown"
|
||
# Follows .github/pull_request_template.md so the bot PR isn't flagged by PR validation.
|
||
body: |
|
||
# 📦 Pull Request
|
||
|
||
## 📝 Description
|
||
|
||
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 }}
|
||
|
||
Triggered by `${{ github.event_name }}`${{ github.event.release.tag_name && format(' — release {0}', github.event.release.tag_name) || '' }} · [run ${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
|
||
|
||
## 🏷️ Ticket / Issue
|
||
|
||
N/A — automated maintenance.
|
||
|
||
### 🖼️ Screenshots / GIFs (if UI)
|
||
|
||
N/A — issue-template metadata only, no app UI.
|
||
|
||
## ✅ Checklist
|
||
|
||
- [x] I’ve read the [contribution guidelines](CONTRIBUTING.md)
|
||
- [x] Verified that changes behave as expected for all platforms
|
||
- [x] Code passes lint/formatting and type checks (`tsc`/`biome`)
|
||
- [x] No secrets, hardcoded credentials, or private config files are included
|
||
- [x] I've declared if AI was used to assist with this PR (by uncommenting the line at the bottom, or not)
|
||
|
||
## 🔍 Testing Instructions
|
||
|
||
N/A — generated by CI from published releases; review the dropdown diff in `issue_report.yml`.
|
||
|
||
- name: 🔀 Enable auto-merge
|
||
if: steps.cpr.outputs.pull-request-operation == 'created'
|
||
env:
|
||
GH_TOKEN: ${{ github.token }}
|
||
# Known limitation: PRs created with GITHUB_TOKEN don't trigger CI workflows
|
||
# (GitHub anti-recursion), so the required checks stay "Expected" until a
|
||
# maintainer kicks them (close/reopen the PR, or push an empty commit).
|
||
# Auto-merge is still worth enabling: once checks run and reviews land,
|
||
# the PR merges itself.
|
||
run: |
|
||
gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}" \
|
||
|| echo "::warning::Could not enable auto-merge — enable 'Allow auto-merge' in repo settings (and branch protection); merge the PR manually for now."
|