diff --git a/.github/workflows/generate-jira-excerpt.yml b/.github/workflows/generate-jira-excerpt.yml
index cf7ececfa..9e0787fe7 100644
--- a/.github/workflows/generate-jira-excerpt.yml
+++ b/.github/workflows/generate-jira-excerpt.yml
@@ -1,4 +1,5 @@
name: "Pull from Armbian Jira"
+
on:
repository_dispatch:
types: ["Jira update"]
@@ -11,36 +12,152 @@ jobs:
jira:
runs-on: ubuntu-24.04
name: "Get from Armbian Jira"
- steps:
+ permissions:
+ contents: write
+ env:
+ JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
+ JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
+ steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
path: armbian.github.io
- - name: setup python
+ - name: Setup Python
uses: actions/setup-python@v6
with:
- python-version: 3.8 #install the python needed
+ python-version: "3.10"
- - name: "Run script"
+ - name: Install Python deps
run: |
- pip install jira
- ./armbian.github.io/scripts/pull-from-jira.py
+ python -m pip install --upgrade pip
+ pip install requests
- - name: Commit changes if any
+ - name: Pull from Jira (inline; same HTML as before)
+ shell: bash
run: |
+ python - <<'PY'
+ # Emits identical structure to the previous pull-from-jira.py
+ import os, sys, html, requests
+ from datetime import datetime
+
+ BASE = "https://armbian.atlassian.net"
+ SEARCH_URL = f"{BASE}/rest/api/3/search/jql"
+ EMAIL = os.environ.get("JIRA_EMAIL")
+ TOKEN = os.environ.get("JIRA_TOKEN")
+ if not EMAIL or not TOKEN:
+ print("Missing JIRA_EMAIL or JIRA_TOKEN", file=sys.stderr)
+ sys.exit(1)
+
+ AUTH = (EMAIL, TOKEN)
+ HEADERS = {"Accept": "application/json"}
+
+ # Icons exactly like before
+ def icons(arg: str) -> str:
+ s = str(arg)
+ if s == "Bug":
+ return ''
+ if s == "Task":
+ return '
'
+ if s == "Story":
+ return '
'
+ if s == "Epic":
+ return '
'
+ return ""
+
+ # Release buckets: 02,05,08,11 (match old logic)
+ now = datetime.now()
+ y = now.year
+ m = int(now.strftime("%m"))
+ if m <= 2:
+ current_year, current_month = y, "02"
+ next_year, next_month = y, "05"
+ elif m <= 5:
+ current_year, current_month = y, "05"
+ next_year, next_month = y, "08"
+ elif m <= 8:
+ current_year, current_month = y, "08"
+ next_year, next_month = y, "11"
+ elif m <= 11:
+ current_year, current_month = y, "11"
+ next_year, next_month = y+1, "02"
+ else:
+ current_year, current_month = y+1, "02"
+ next_year, next_month = y+1, "05"
+
+ current_fix = f"{str(current_year)[2:]}.{current_month}"
+ next_fix = f"{str(next_year)[2:]}.{next_month}"
+ FIELDS = "summary,issuetype,assignee,priority,status"
+
+ def fetch_all(jql: str, page=100):
+ start = 0
+ out = []
+ while True:
+ params = {"jql": jql, "fields": FIELDS, "startAt": start, "maxResults": page}
+ r = requests.get(SEARCH_URL, params=params, headers=HEADERS, auth=AUTH, timeout=30)
+ if r.status_code >= 400:
+ print(f"Jira API error {r.status_code}: {r.text}", file=sys.stderr)
+ sys.exit(1)
+ data = r.json()
+ chunk = data.get("issues", [])
+ out.extend(chunk)
+ total = data.get("total", len(out))
+ if not chunk or start + len(chunk) >= total:
+ break
+ start += len(chunk)
+ return out
+
+ # EXACT same top-matter as before (markdown-ish in .html)
+ def write_current():
+ with open("jira-current.html", "w", encoding="utf-8") as f:
+ f.write('\n\n
\n