Skip to content

Commit 440775d

Browse files
committed
update the bug report yaml
1 parent 9221057 commit 440775d

2 files changed

Lines changed: 167 additions & 10 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 75 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,87 @@ body:
1616
validations:
1717
required: true
1818
attributes:
19-
label: What Mammotion mower are you using?
19+
label: What Mammotion device are you using?
20+
description: >
21+
Pick the exact SKU printed on your box / shown in the Mammotion app.
22+
Variant suffixes follow Mammotion's product line:
23+
**H** = with UltraSense AI Vision, **X** = with 4G/cellular,
24+
**HX** = both AI Vision and 4G.
25+
If your model isn't listed, choose "Other / not listed" and put the
26+
full model name in the description above.
2027
options:
21-
- Luba 1
22-
- Luba 2
23-
- Luba 2x
24-
- Luba mini
25-
- Yuka
26-
- Yuka 2
27-
- Yuka mini
28-
- type: input
28+
- Luba 1 AWD 1000
29+
- Luba 1 AWD 3000
30+
- Luba 1 AWD 5000
31+
- Luba 2 AWD 3000X
32+
- Luba 2 AWD 3000HX
33+
- Luba 2 AWD 5000X
34+
- Luba 2 AWD 5000HX
35+
- Luba 2 AWD 10000X
36+
- Luba 2 AWD 10000HX
37+
- Luba 3 AWD 1500
38+
- Luba 3 AWD 1500H
39+
- Luba 3 AWD 3000
40+
- Luba 3 AWD 3000H
41+
- Luba 3 AWD 5000
42+
- Luba 3 AWD 5000H
43+
- Luba mini AWD 800
44+
- Luba mini AWD 800H
45+
- Luba mini AWD 1500
46+
- Luba mini AWD 1500H
47+
- Luba mini 2 AWD 1500
48+
- Luba mini 2 AWD 1500H
49+
- Yuka 1000
50+
- Yuka 2000
51+
- Yuka 3000
52+
- Yuka mini 500
53+
- Yuka mini 500H
54+
- Yuka mini 600
55+
- Yuka mini 600H
56+
- Yuka mini 700
57+
- Yuka mini 700H
58+
- Yuka mini 800
59+
- Yuka mini 800H
60+
- Yuka mini 2 1000H
61+
- Spino E1
62+
- Spino S1 Pro
63+
- Other / not listed (specify in description)
64+
- type: dropdown
2965
id: integration_version
3066
validations:
3167
required: true
3268
attributes:
3369
label: What version of the Mammotion integration are you using?
34-
placeholder: 4280d63, unsure
70+
description: >
71+
Pick the exact version installed on your Home Assistant. If you are
72+
on a version older than those listed, choose "Older / not listed" and
73+
include the version (or the commit SHA from `manifest.json`'s
74+
`version` field) in the description above. Do **not** select a newer
75+
version than what you actually have installed.
76+
# BEGIN AUTO-GENERATED VERSION LIST (refreshed by .github/workflows/update-issue-template.yml — do not hand-edit)
77+
options:
78+
- v0.5.45
79+
- v0.5.45-beta5
80+
- v0.5.45-beta4
81+
- v0.5.45-beta3
82+
- v0.5.45-beta2
83+
- v0.5.45-beta1
84+
- v0.5.44
85+
- v0.5.43
86+
- v0.5.42
87+
- v0.5.42-beta2
88+
- v0.5.42-beta1
89+
- v0.5.41
90+
- v0.5.41-beta2
91+
- v0.5.41-beta1
92+
- v0.5.40
93+
- v0.5.39
94+
- v0.5.39-beta2
95+
- v0.5.39-beta1
96+
- v0.5.38
97+
- v0.5.37
98+
- Older / not listed (specify in description)
99+
# END AUTO-GENERATED VERSION LIST
35100
- type: input
36101
id: ha_version
37102
validations:
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Refresh issue template version dropdown
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
refresh:
14+
name: Refresh integration_version options
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout main
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
ref: main
22+
23+
- name: Regenerate version options block
24+
env:
25+
MAX_TAGS: "20"
26+
run: |
27+
python3 - <<'PY'
28+
import os
29+
import re
30+
import subprocess
31+
32+
MAX_TAGS = int(os.environ.get("MAX_TAGS", "20"))
33+
34+
tags = subprocess.check_output(
35+
["git", "tag", "--sort=-creatordate"],
36+
text=True,
37+
).strip().splitlines()
38+
tags = [t for t in tags if t.startswith("v")][:MAX_TAGS]
39+
if not tags:
40+
raise SystemExit("No v-prefixed tags found; aborting.")
41+
42+
path = ".github/ISSUE_TEMPLATE/bug_report.yml"
43+
with open(path, "r", encoding="utf-8") as f:
44+
original = f.read()
45+
46+
# Indentation matches the existing options: block in the dropdown
47+
# (siblings: label, description, options). See bug_report.yml.
48+
indent = " "
49+
item_indent = " "
50+
51+
new_block_lines = [
52+
f"{indent}# BEGIN AUTO-GENERATED VERSION LIST (refreshed by .github/workflows/update-issue-template.yml — do not hand-edit)",
53+
f"{indent}options:",
54+
]
55+
for tag in tags:
56+
new_block_lines.append(f"{item_indent}- {tag}")
57+
new_block_lines.append(f"{item_indent}- Older / not listed (specify in description)")
58+
new_block_lines.append(f"{indent}# END AUTO-GENERATED VERSION LIST")
59+
new_block = "\n".join(new_block_lines)
60+
61+
pattern = re.compile(
62+
re.escape(f"{indent}# BEGIN AUTO-GENERATED VERSION LIST")
63+
+ r".*?"
64+
+ re.escape(f"{indent}# END AUTO-GENERATED VERSION LIST"),
65+
re.DOTALL,
66+
)
67+
if not pattern.search(original):
68+
raise SystemExit(
69+
"Could not find AUTO-GENERATED VERSION LIST markers in bug_report.yml"
70+
)
71+
72+
updated = pattern.sub(new_block, original)
73+
if updated == original:
74+
print("No change.")
75+
raise SystemExit(0)
76+
77+
with open(path, "w", encoding="utf-8") as f:
78+
f.write(updated)
79+
print(f"Updated dropdown with {len(tags)} tag(s); newest: {tags[0]}")
80+
PY
81+
82+
- name: Commit and push if changed
83+
run: |
84+
if git diff --quiet -- .github/ISSUE_TEMPLATE/bug_report.yml; then
85+
echo "No changes to commit."
86+
exit 0
87+
fi
88+
git config user.name "github-actions[bot]"
89+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
90+
git add .github/ISSUE_TEMPLATE/bug_report.yml
91+
git commit -m "chore: refresh issue template version dropdown"
92+
git push origin main

0 commit comments

Comments
 (0)