mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
Most of the official actions move one or more majors, onto the Node 24 runtime. The inputs these workflows pass are still accepted, and the contract tests that pin the checkout and App token commits follow. Since checkout v6 the persisted token lives in a separate config file, so unsetting the extra header in .git/config no longer removes it. The release job's checkout stops persisting credentials, so its staging branch push goes out with the App token, and a contract test guards that setting. The flux action stays on v2.8.6, whose tag has to equal the Flux CLI version it installs. A self-hosted runner needs v2.327.1 or newer for the Node 24 checkout, which the Proxmox workflow now states next to its runs-on. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>
88 lines
2.5 KiB
YAML
88 lines
2.5 KiB
YAML
name: Labels
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- .github/labels.yml
|
|
- .github/workflows/labels.yaml
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- .github/labels.yml
|
|
- .github/workflows/labels.yaml
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '17 4 * * 1' # Mondays at 04:17 UTC
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: labels-sync
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: Validate labels.yml schema
|
|
run: |
|
|
python3 - <<'PY'
|
|
import re, sys, yaml
|
|
|
|
path = '.github/labels.yml'
|
|
data = yaml.safe_load(open(path))
|
|
errors = []
|
|
|
|
# 1. description ≤ 100 chars (GitHub REST API limit)
|
|
for label in data:
|
|
desc = label.get('description', '') or ''
|
|
if len(desc) > 100:
|
|
errors.append(f"{label['name']}: description {len(desc)} chars (max 100)")
|
|
|
|
# 2. color is 6-char hex without leading #
|
|
for label in data:
|
|
color = label.get('color', '') or ''
|
|
if not re.match(r'^[0-9A-Fa-f]{6}$', color):
|
|
errors.append(f"{label['name']}: bad color {color!r} (must be 6-char hex without #)")
|
|
|
|
# 3. unique top-level names
|
|
names = [label['name'] for label in data]
|
|
dups = sorted({n for n in names if names.count(n) > 1})
|
|
for n in dups:
|
|
errors.append(f"duplicate name: {n}")
|
|
|
|
# 4. aliases do not collide with any top-level name
|
|
name_set = set(names)
|
|
for label in data:
|
|
for alias in (label.get('aliases') or []):
|
|
if alias in name_set:
|
|
errors.append(f"alias {alias!r} (under {label['name']!r}) collides with a top-level name")
|
|
|
|
if errors:
|
|
for err in errors:
|
|
print(f"::error::{err}")
|
|
sys.exit(1)
|
|
|
|
print(f"labels.yml schema OK ({len(data)} labels)")
|
|
PY
|
|
|
|
sync:
|
|
needs: validate
|
|
if: github.event_name != 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
pull-requests: write
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
- uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2.3.3
|
|
with:
|
|
config-file: .github/labels.yml
|
|
delete-other-labels: false
|