diff --git a/.github/scripts/prepare_release_line.py b/.github/scripts/prepare_release_line.py new file mode 100644 index 000000000..de7dd67c4 --- /dev/null +++ b/.github/scripts/prepare_release_line.py @@ -0,0 +1,399 @@ +# SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +# SPDX-License-Identifier: GPL-3.0-or-later +"""Prepare only the 17 G2 members from the merged, trusted dde configuration.""" + +import copy +import json +import os +from pathlib import Path +import re +import subprocess +import sys +import time +from urllib.parse import quote, urlencode + +import yaml + + +sys.path.insert(0, str(Path(os.environ.get("COORDINATOR_DIR", "coordinator")) / + ".github/scripts")) +from release_line_checks import ( # noqa: E402 + GUARD_CONTEXT, SHA_RE, WORKFLOW_FILES, ReadinessError, _enabled, _matches, + api, branch_info, check_member_ready, check_member_workflows, + check_workflow_file, content, g2_members, protection_ready, read_protection, release_lines, + release_app_id, +) + + +def _ancestors(api, repo, base, head): + value = api(f"repos/{repo}/compare/{base}...{head}") + if value["merge_base_commit"]["sha"].lower() != base.lower(): + raise RuntimeError(f"{repo} 目标分支不包含基准 {base},禁止 force/reset/delete") + + +def _wait_branch(api, repo, branch, attempts=10): + for _ in range(attempts): + target = branch_info(api, repo, branch, missing=True) + if target: + return target + time.sleep(1) + raise RuntimeError(f"{repo}:{branch} 创建后未可读") + + +def _installation_repositories(api): + result, page = set(), 1 + while True: + value = api(f"installation/repositories?per_page=100&page={page}") + if (not isinstance(value, dict) or type(value.get("total_count")) is not int + or value["total_count"] < 0 or not isinstance(value.get("repositories"), list)): + raise RuntimeError("当前 App 仓库范围响应无法确认") + entries = value["repositories"] + if any(not isinstance(repo, dict) or not isinstance(repo.get("full_name"), str) + or not repo["full_name"] for repo in entries): + raise RuntimeError("当前 App 仓库范围条目无法确认") + names = {repo["full_name"] for repo in entries} + if len(names) != len(entries) or result & names: + raise RuntimeError("当前 App 仓库范围分页重复,请重跑") + result.update(names) + if len(result) == value["total_count"]: + return result + if not entries or len(result) > value["total_count"]: + raise RuntimeError("当前 App 仓库范围分页不完整,请重跑") + page += 1 + + +def _creation_rules(api, repo): + owner, name = repo.split("/") + result, cursor = [], None + while True: + value = api("graphql", {"query": """ + query($owner:String!, $name:String!, $cursor:String) { + repository(owner:$owner, name:$name) { + branchProtectionRules(first:100, after:$cursor) { + nodes { + pattern blocksCreations restrictsPushes + pushAllowances(first:100) { + totalCount nodes { actor { __typename ... on App { databaseId } } } + } + } + pageInfo { hasNextPage endCursor } + } + } + }""", "variables": {"owner": owner, "name": name, "cursor": cursor}}) + rules = value["data"]["repository"]["branchProtectionRules"] + result.extend(rules["nodes"]) + if not rules["pageInfo"]["hasNextPage"]: + return result + cursor = rules["pageInfo"]["endCursor"] + if not cursor: + raise RuntimeError(f"{repo} 创建权限分页不可确认") + + +def _may_create(api, repo, branch, app_id, rules): + for rule in rules: + if not _matches(rule["pattern"], branch): + continue + if rule.get("blocksCreations") is None or rule.get("restrictsPushes") is None: + raise RuntimeError(f"{repo}:{branch} 创建保护权限未知") + if rule["blocksCreations"] and rule["restrictsPushes"]: + allowances = rule["pushAllowances"] + if allowances["totalCount"] != len(allowances["nodes"]) or not any( + node.get("actor") and node["actor"].get("__typename") == "App" + and node["actor"].get("databaseId") == app_id for node in allowances["nodes"]): + raise RuntimeError(f"{repo}:{branch} 当前 App 未获受限分支创建权限") + effective = api(f"repos/{repo}/rules/branches/{quote(branch, safe='')}?per_page=100", + paginate=True) + if not isinstance(effective, list): + raise RuntimeError(f"{repo}:{branch} 有效创建规则不可读取") + for rule in effective: + if rule.get("type") != "creation": + continue + value = api(f"repos/{repo}/rulesets/{rule['ruleset_id']}?includes_parents=true") + actors = value.get("bypass_actors") + if value.get("enforcement") != "active" or not isinstance(actors, list) or not any( + actor.get("actor_type") == "Integration" and actor.get("actor_id") == app_id + and actor.get("bypass_mode") == "always" for actor in actors): + raise RuntimeError(f"{repo}:{branch} 当前 App 创建权限被有效规则限制或不可确认") + + +def _templates(template_root, api, repo, branches): + config = Path(template_root) / "repos" / (repo + ".json") + entries = json.loads(config.read_text(encoding="utf-8")) + result = {} + for filename in WORKFLOW_FILES: + dest = f"{repo}/.github/workflows/{filename}" + matches = [entry for entry in entries if entry.get("dest") == dest] + if len(matches) != 1: + raise RuntimeError(f"{config}: 必须有唯一 {filename} 配置") + entry = matches[0] + patterns = entry.get("branches") + if not isinstance(patterns, list) or not patterns or entry.get("deletelist"): + raise RuntimeError(f"{config}: {filename} 必须用 branches 显式覆盖,不能删除入口") + if any(not any(re.match("^" + pattern, branch) for pattern in patterns) for branch in branches): + raise RuntimeError(f"{config}: {filename} 未覆盖默认/目标分支") + if entry.get("src") != f"workflow-templates/{filename}": + raise RuntimeError(f"{config}: 必须复用现有 {filename} 模板") + result[filename] = (Path(template_root) / entry["src"]).read_text(encoding="utf-8") + for branch in branches: + check_workflow_file(api, repo, filename, "trusted-template", branch, + text=result[filename]) + return result + + +def _actors(value): + if value is None: + return None + return {kind: [actor if isinstance(actor, str) else actor["login" if kind == "users" else "slug"] + for actor in value.get(kind, [])] for kind in ("users", "teams", "apps")} + + +def protection_payload(target, default, app_id): + """Preserve review policy/check bindings; add only the required restrictions.""" + source = target["classic"] if target["classic"] is not None else default["classic"] or {} + reviews = source.get("required_pull_request_reviews") + if reviews is None and target["classic"] is not None: + reviews = (default["classic"] or {}).get("required_pull_request_reviews") + reviews = copy.deepcopy(reviews or {}) + reviews.pop("url", None) + if "dismissal_restrictions" in reviews: + reviews["dismissal_restrictions"] = _actors(reviews["dismissal_restrictions"]) + reviews["bypass_pull_request_allowances"] = {"users": [], "teams": [], "apps": []} + reviews.setdefault("required_approving_review_count", 0) + reviews.setdefault("dismiss_stale_reviews", False) + reviews.setdefault("require_code_owner_reviews", False) + reviews.setdefault("require_last_push_approval", False) + checks = {} + status = source.get("required_status_checks") or {} + for check in status.get("checks", []): + checks[check["context"]] = check.get("app_id") if check.get("app_id") is not None else -1 + for context in status.get("contexts", []): + checks.setdefault(context, -1) + policy_rules = target["rules"] + (default["rules"] if target["classic"] is None else []) + for rule in policy_rules: + parameters = rule.get("parameters", {}) + if rule["type"] == "pull_request": + reviews["required_approving_review_count"] = max( + reviews["required_approving_review_count"], parameters.get("required_approving_review_count", 0)) + for field in ("dismiss_stale_reviews_on_push", "require_code_owner_review", + "require_last_push_approval"): + dest = {"dismiss_stale_reviews_on_push": "dismiss_stale_reviews", + "require_code_owner_review": "require_code_owner_reviews"}.get(field, field) + if parameters.get(field): + reviews[dest] = True + if rule["type"] == "required_status_checks": + for check in parameters.get("required_status_checks", []): + name, binding = check["context"], check.get("integration_id") or -1 + if name != GUARD_CONTEXT and name in checks and checks[name] != binding: + raise RuntimeError(f"同一必需检查 {name} 有冲突 App 绑定,不能覆盖现有规则") + checks[name] = binding + checks[GUARD_CONTEXT] = app_id + payload = { + "required_status_checks": {"strict": True, "checks": [ + {"context": context, "app_id": binding} for context, binding in checks.items()]}, + "required_pull_request_reviews": reviews, + "enforce_admins": True, + "restrictions": _actors(source.get("restrictions")), + "allow_force_pushes": False, + "allow_deletions": False, + } + for name in ("required_linear_history", "block_creations", "required_conversation_resolution", + "lock_branch", "allow_fork_syncing"): + if name in source: + payload[name] = _enabled(source, name) + return payload + + +def verify_preserved(actual, expected, app_id): + normalized = protection_payload(actual, {"classic": None, "rules": []}, app_id) + for key, value in expected.items(): + if key == "required_status_checks": + observed = {(check["context"], check["app_id"]) + for check in normalized[key]["checks"]} + if not all((check["context"], check["app_id"]) in observed for check in value["checks"]): + raise ReadinessError("PROTECTION_FAILED", "读回丢失了已有必需检查或 App 绑定") + elif normalized.get(key) != value: + raise ReadinessError("PROTECTION_FAILED", f"保护读回未保留 {key}") + + +def sync_templates(api, owner): + """Run the existing organization template sync and wait for its result.""" + repo = f"{owner}/.github" + default = api(f"repos/{repo}")["default_branch"] + query = urlencode({"branch": default, "event": "workflow_dispatch", "per_page": 20}) + previous = {run["id"] for run in + api(f"repos/{repo}/actions/workflows/templates-sync.yml/runs?{query}")["workflow_runs"]} + api(f"repos/{repo}/actions/workflows/templates-sync.yml/dispatches", + {"ref": default}, method="POST") + deadline = time.monotonic() + 900 + while time.monotonic() < deadline: + runs = api(f"repos/{repo}/actions/workflows/templates-sync.yml/runs?{query}")["workflow_runs"] + run = next((item for item in runs if item["id"] not in previous), None) + if run and run["status"] == "completed": + if run["conclusion"] != "success": + raise RuntimeError(f"模板同步失败: {run['html_url']}") + return run + time.sleep(5) + raise RuntimeError("模板同步超时,请查看 templates-sync 工作流") + + +def _report(rows): + lines = ["| 成员 | 分支预检 | 实际状态 | 说明/待合并 PR |", + "|---|---|---|---|"] + for row in rows: + lines.append(f"| {row['repo']} | {row['operation']} | {row.get('state', '预检')} | " + f"{row.get('detail', '').replace('|', '/').replace(chr(10), ' ')} |") + text = "\n".join(lines) + "\n" + print(text) + if os.environ.get("GITHUB_STEP_SUMMARY"): + with open(os.environ["GITHUB_STEP_SUMMARY"], "a", encoding="utf-8") as summary: + summary.write(text) + + +def prepare(api, coordinator, config_sha, template_root, line, dry_run=True, + can_create=False, app_id=None, admin_write=False): + info = api(f"repos/{coordinator}") + current = branch_info(api, coordinator, info["default_branch"])["commit"]["sha"] + if not isinstance(config_sha, str) or not SHA_RE.fullmatch(config_sha): + raise RuntimeError("Prepare 必须从可信 dde 默认分支 checkout 的固定 SHA 读配置") + _ancestors(api, coordinator, config_sha, current) + cfg = yaml.safe_load(content(api, coordinator, "groups.yaml", config_sha)) + lines = release_lines(cfg) + if line == "master" or line not in lines: + raise RuntimeError("Prepare 只接受已合并的新增 G2 develop 发布线") + members = g2_members(cfg, coordinator.split("/")[0]) + branch, bases = lines[line]["member_branch"], lines[line].get("bases") + if not isinstance(bases, dict) or set(bases) != {member for member, _ in members}: + raise RuntimeError("已合并 bases 必须恰好包含 17 个 G2 成员") + if not can_create or type(app_id) is not int: + raise RuntimeError("当前 App 的 Contents/Workflows/PR 写权限或身份不可确认") + # App tokens omit permissions.push; the trusted workflow requests write grants. + installed = _installation_repositories(api) + rows = [] + for member, repo in members: + row = {"repo": repo, "member": member, "operation": "conflict"} + rows.append(row) + try: + sha = bases[member] + if not isinstance(sha, str) or not SHA_RE.fullmatch(sha): + raise RuntimeError("基准不是完整 40 字符 commit SHA") + if repo not in installed: + raise RuntimeError("成员仓库不在当前 App 令牌的授权范围") + member_info = api(f"repos/{repo}") + if member_info.get("archived") is not False or member_info.get("disabled") is not False: + raise RuntimeError("仓库归档、禁用或状态不可确认") + commit = api(f"repos/{repo}/git/commits/{sha}") + if commit.get("sha", "").lower() != sha.lower(): + raise RuntimeError("基准 commit 不在对应成员仓库中") + target = branch_info(api, repo, branch, missing=True) + if target: + _ancestors(api, repo, sha, target["commit"]["sha"]) + read_protection(api, repo, branch, target) + default = member_info["default_branch"] + read_protection(api, repo, default) + create_rules = _creation_rules(api, repo) + if not target: + _may_create(api, repo, branch, app_id, create_rules) + row.update(operation="existing" if target else "create", base=sha, default=default, + templates=_templates(template_root, api, repo, (default, branch))) + except Exception as error: + row.update(operation="conflict", detail=str(error)) + _report(rows) + if any(row["operation"] == "conflict" for row in rows): + raise RuntimeError("全部成员预检未通过;未创建任何分支、同步模板或保护") + if dry_run: + for row in rows: + try: + if row["operation"] == "create": + raise ReadinessError("BRANCH_MISSING", f"将从固定基准 {row['base']} 创建") + if any(content(api, row["repo"], f".github/workflows/{name}", base, missing=True) != text + for base in dict.fromkeys((row["default"], branch)) + for name, text in row["templates"].items()): + raise ReadinessError("TEMPLATE_MISSING", "正式运行将调用统一模板同步") + check_member_ready(api, row["repo"], branch, app_id) + row["state"] = "READY" + except ReadinessError as error: + row.update(state=error.state, detail=str(error)) + except Exception as error: + row.update(state="PROTECTION_FAILED", detail=str(error)) + _report(rows) + return rows + live_cfg = yaml.safe_load(content(api, coordinator, "groups.yaml", + branch_info(api, coordinator, info["default_branch"])["commit"]["sha"])) + if release_lines(live_cfg).get(line) != lines[line] or g2_members(live_cfg, coordinator.split("/")[0]) != members: + raise RuntimeError("已审核的分支/bases/成员配置在预检期间改变,请重跑") + for row in rows: + try: + target = branch_info(api, row["repo"], branch, missing=True) + if target is None: + try: + api(f"repos/{row['repo']}/git/refs", {"ref": f"refs/heads/{branch}", "sha": row["base"]}) + except RuntimeError: + target = branch_info(api, row["repo"], branch, missing=True) + if target is None: + raise + target = _wait_branch(api, row["repo"], branch) + _ancestors(api, row["repo"], row["base"], target["commit"]["sha"]) + except Exception as error: + row.update(operation="conflict", detail=str(error)) + _report(rows) + raise RuntimeError("分支创建中断;保留所有已创建分支,重跑只补缺失项") from error + if any(content(api, row["repo"], f".github/workflows/{name}", base, missing=True) != text + for row in rows for base in dict.fromkeys((row["default"], branch)) + for name, text in row["templates"].items()): + sync_templates(api, coordinator.split("/")[0]) + for row in rows: + try: + target = branch_info(api, row["repo"], branch) + _ancestors(api, row["repo"], row["base"], target["commit"]["sha"]) + except Exception as error: + row.update(operation="conflict", detail=str(error)) + _report(rows) + raise RuntimeError("模板同步后目标分支不再包含固定基准,请人工核实") from error + for row in rows: + state = "TEMPLATE_MISSING" + try: + repo = row["repo"] + state = "WORKFLOW_INACTIVE" + for filename in WORKFLOW_FILES: + workflow = api(f"repos/{repo}/actions/workflows/{filename}", missing=True) + if workflow and workflow.get("state") in ("disabled_manually", "disabled_inactivity"): + api(f"repos/{repo}/actions/workflows/{filename}/enable", method="PUT") + check_member_workflows(api, repo, branch) + state = "PROTECTION_FAILED" + app_source = release_app_id(app_id) + target = read_protection(api, repo, branch) + if not protection_ready(target, app_source): + default = read_protection(api, repo, row["default"]) + latest_target = read_protection(api, repo, branch) + latest_default = read_protection(api, repo, row["default"]) + if latest_target != target: + raise ReadinessError(state, "分支保护在预检后发生变化,请重跑 Prepare") + payload = protection_payload(latest_target, latest_default, app_source) + if not admin_write: + raise ReadinessError(state, f"{repo} App 无 Admin Write;管理员保留现有审核/检查并配置" + f"保护后重跑: https://github.com/{repo}/settings/branches") + api(f"repos/{repo}/branches/{quote(branch, safe='')}/protection", payload, method="PUT") + observed = read_protection(api, repo, branch) + verify_preserved(observed, payload, app_source) + check_member_ready(api, repo, branch, app_id) + target = branch_info(api, repo, branch) + _ancestors(api, repo, row["base"], target["commit"]["sha"]) + row.update(state="READY", detail="已读回验证入口、workflow 启用与实际有效保护") + except ReadinessError as error: + row.update(state=error.state, detail=str(error)) + except Exception as error: + row.update(state=state, detail=str(error)) + _report(rows) + if any(row["state"] != "READY" for row in rows): + raise RuntimeError("G2 尚未全部 READY;修复模板同步或保护配置后重跑 Prepare") + return rows + + +if __name__ == "__main__": + coordinator_dir = Path(os.environ.get("COORDINATOR_DIR", "coordinator")) + sha = subprocess.check_output(["git", "-C", str(coordinator_dir), "rev-parse", "HEAD"], + text=True).strip() + prepare(api, os.environ["GITHUB_REPOSITORY_OWNER"] + "/dde", sha, Path.cwd(), + os.environ["RELEASE_LINE"], os.environ.get("DRY_RUN", "true").lower() == "true", + os.environ.get("CAN_CREATE_BRANCH") == "true", int(os.environ["APP_ID"]), + os.environ.get("ADMIN_WRITE") == "true") diff --git a/.github/workflows/prepare-release-line.yml b/.github/workflows/prepare-release-line.yml new file mode 100644 index 000000000..3704d6289 --- /dev/null +++ b/.github/workflows/prepare-release-line.yml @@ -0,0 +1,97 @@ +# SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +# SPDX-License-Identifier: GPL-3.0-or-later +name: Prepare release line + +on: + workflow_dispatch: + inputs: + release_line: + description: 已合并配置的 G2 发布线 ID + required: true + type: string + dry_run: + description: 只读全部预检与实际就绪状态 + required: false + type: boolean + default: true + +permissions: + contents: read + +concurrency: + group: prepare-release-line-${{ inputs.release_line }} + cancel-in-progress: false + queue: max + +jobs: + prepare: + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + environment: release-line-prepare + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Create installation token + id: app_token + uses: actions/create-github-app-token@v3 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + permission-actions: write + permission-contents: write + permission-pull-requests: read + permission-administration: read + + - name: Verify maintainer + if: ${{ !inputs.dry_run }} + env: + GH_TOKEN: ${{ steps.app_token.outputs.token }} + ACTOR: ${{ github.actor }} + run: | + permission=$(gh api "repos/$GITHUB_REPOSITORY/collaborators/$ACTOR/permission" --jq .permission) + case "$permission" in + admin|maintain) ;; + *) echo "::error::$ACTOR does not have maintainer permission"; exit 1 ;; + esac + + - name: Try Administration Write for protection + id: admin_token + if: ${{ !inputs.dry_run }} + continue-on-error: true + uses: actions/create-github-app-token@v3 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + permission-actions: write + permission-contents: write + permission-pull-requests: read + permission-administration: write + + - name: Checkout trusted template default branch + uses: actions/checkout@v5 + with: + ref: ${{ github.event.repository.default_branch }} + persist-credentials: false + + - name: Checkout trusted dde default branch + uses: actions/checkout@v5 + with: + repository: ${{ github.repository_owner }}/dde + token: ${{ steps.app_token.outputs.token }} + path: coordinator + persist-credentials: false + + - name: Install deps + run: pip install --quiet pyyaml + + - name: Prepare and verify G2 members + env: + GH_TOKEN: ${{ steps.admin_token.outputs.token || steps.app_token.outputs.token }} + APP_ID: ${{ secrets.APP_ID }} + RELEASE_LINE: ${{ inputs.release_line }} + DRY_RUN: ${{ inputs.dry_run }} + ADMIN_WRITE: ${{ steps.admin_token.outcome == 'success' }} + CAN_CREATE_BRANCH: "true" + COORDINATOR_DIR: coordinator + run: python3 .github/scripts/prepare_release_line.py diff --git a/.github/workflows/templates-sync.yml b/.github/workflows/templates-sync.yml index 9c0aaea21..3c6134871 100644 --- a/.github/workflows/templates-sync.yml +++ b/.github/workflows/templates-sync.yml @@ -14,7 +14,7 @@ concurrency: jobs: templates-sync: # limit push on linuxdeepin/.github master branch - if: github.repository == 'linuxdeepin/.github' && github.ref == 'refs/heads/master' + if: github.repository == 'linuxdeepin/.github' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 @@ -37,7 +37,6 @@ jobs: separator: " " files: | workflow-templates/*.yml - .github/workflows/templates-sync.yml # Install ssh key and known_hosts - name: Git config @@ -54,7 +53,7 @@ jobs: - name: Sync changed configs uses: linuxdeepin/action-sync@main - if: steps.changed-configs.outputs.any_changed == 'true' + if: steps.changed-configs.outputs.any_changed == 'true' && steps.changed-files.outputs.any_changed != 'true' with: files: "${{ steps.changed-configs.outputs.all_changed_files }}" message: | @@ -67,14 +66,14 @@ jobs: - name: Get all configs id: all-configs - if: steps.changed-files.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch' + if: github.event_name != 'workflow_dispatch' && steps.changed-files.outputs.any_changed == 'true' && steps.changed-configs.outputs.any_changed != 'true' run: | all_configs=`find repos -type f | grep json | xargs` echo all configs $all_configs echo "ALL_CONFIGS=$all_configs" >> $GITHUB_OUTPUT - name: Sync all files uses: linuxdeepin/action-sync@main - if: steps.changed-files.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch' + if: github.event_name != 'workflow_dispatch' && steps.changed-files.outputs.any_changed == 'true' && steps.changed-configs.outputs.any_changed != 'true' with: files: "${{ steps.all-configs.outputs.ALL_CONFIGS }}" message: | @@ -84,3 +83,54 @@ jobs: Log: none Influence: none + + - name: Prepare release-line sync configs + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && steps.changed-configs.outputs.any_changed == 'true') + run: | + python3 - <<'PY' + import json + import os + from pathlib import Path + + owner = os.environ["GITHUB_REPOSITORY_OWNER"] + names = { + "call-update-changelog.yml": Path(".github/release-line-update.json"), + "call-verify-group-version.yml": Path(".github/release-line-guard.json"), + } + output = {name: [] for name in names} + for path in Path("repos", owner).glob("*.json"): + found = {} + for entry in json.loads(path.read_text(encoding="utf-8")): + name = Path(entry.get("src", "")).name + if name in names and entry.get("dest", "").startswith(f"{owner}/"): + found[name] = entry + if set(found) == set(names): + for name, entry in found.items(): + output[name].append(entry) + for name, entries in output.items(): + if not entries: + raise RuntimeError(f"missing release-line config: {name}") + names[name].write_text(json.dumps(entries, ensure_ascii=False), encoding="utf-8") + PY + + - name: Sync release-line update template + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && steps.changed-configs.outputs.any_changed == 'true') + uses: linuxdeepin/action-sync@main + with: + files: .github/release-line-update.json + message: | + chore: Sync release-line update template + + Log: none + Influence: none + + - name: Sync release-line guard template + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && steps.changed-configs.outputs.any_changed == 'true') + uses: linuxdeepin/action-sync@main + with: + files: .github/release-line-guard.json + message: | + chore: Sync release-line guard template + + Log: none + Influence: none diff --git a/.github/workflows/verify-group-version.yml b/.github/workflows/verify-group-version.yml index 30cfbfe8a..2f96af1ae 100644 --- a/.github/workflows/verify-group-version.yml +++ b/.github/workflows/verify-group-version.yml @@ -1,11 +1,18 @@ +# SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +# SPDX-License-Identifier: GPL-3.0-or-later name: Verify group version -on: workflow_call +on: + workflow_call: + secrets: + APP_ID: + required: true + APP_PRIVATE_KEY: + required: true permissions: contents: read pull-requests: read - statuses: write jobs: verify: @@ -15,10 +22,22 @@ jobs: group: group-version-guard-${{ github.event.pull_request.head.sha }} cancel-in-progress: false env: - GH_TOKEN: ${{ github.token }} PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} steps: + - name: Create release App token + id: release_token + uses: actions/create-github-app-token@v3 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + permission-contents: read + permission-pull-requests: read + permission-statuses: write + - name: Mark version check pending + env: + GH_TOKEN: ${{ steps.release_token.outputs.token }} run: | gh api "repos/$GITHUB_REPOSITORY/statuses/$PR_HEAD_SHA" --method POST \ -f state=pending -f context=group-version-guard \ @@ -33,6 +52,7 @@ jobs: run: | python3 - <<'PY' import base64 + import datetime import json import os import re @@ -73,13 +93,69 @@ jobs: overrides = cfg.get("repo_overrides", {}) return [f"{owner}/{overrides.get(m, m)}" for m in cfg["groups"][group]["members"]] - def release_record(repo, sha, group): + def linglong_versions(repo, sha): + tree = api(f"repos/{repo}/git/trees/{sha}") + if tree.get("truncated") is not False or not isinstance(tree.get("tree"), list): + raise RuntimeError(f"无法完整检测 {repo}@{sha} 的 Linglong 版本文件") + versions = {} + for entry in tree["tree"]: + path = entry["path"] + if not re.fullmatch(r"linglong[^/]*\.yaml", path): + continue + if entry["type"] != "blob" or entry["mode"] not in ("100644", "100755"): + raise RuntimeError(f"{repo}@{sha} 的 {path} 不是普通版本文件") + try: + recipe = yaml.safe_load(content(repo, path, sha)) + version = recipe["package"]["version"] + except (yaml.YAMLError, KeyError, TypeError) as error: + raise RuntimeError(f"无法读取 {repo}@{sha} 的 {path} package.version") from error + if (not isinstance(version, str) or not version.strip() + or subprocess.run(["dpkg", "--validate-version", version]).returncode): + raise RuntimeError(f"{repo}@{sha} 的 {path} version 无效") + versions[path] = version + return versions + + def release_line(cfg, base): + versions = cfg["groups"]["G2"]["versions"] + lines = cfg.get("release_lines") + if not isinstance(versions, dict) or not versions or not isinstance(lines, dict): + raise RuntimeError("G2 发布线配置缺失或异常") + branches = [] + for line, value in lines.items(): + branch = value.get("member_branch") if isinstance(value, dict) else None + if (not isinstance(line, str) or not re.fullmatch(r"[A-Za-z0-9._-]+", line) + or not isinstance(branch, str) or not branch + or (line == "master" and branch != "master") + or (line != "master" and not branch.startswith("develop/")) + or subprocess.run(["git", "check-ref-format", "--branch", branch], + capture_output=True).returncode + or subprocess.run(["git", "check-ref-format", f"refs/heads/baseline/{line}/G2"], + capture_output=True).returncode): + raise RuntimeError("G2 发布线 ID 或成员分支无效") + branches.append(branch) + if len(branches) != len(set(branches)) or set(versions) != set(lines): + raise RuntimeError("G2 发布线成员分支映射不唯一或版本集合不符") + matches = [line for line, value in lines.items() if value["member_branch"] == base] + if len(matches) != 1 or matches[0] not in versions: + raise RuntimeError(f"G2 PR 目标分支 {base} 不属于唯一的发布线") + return matches[0] + + def release_record(repo, sha, group, line=None): commit = api(f"repos/{repo}/git/commits/{sha}") for hops in range(101): if MARKER in commit["message"]: release = json.loads(commit["message"].split(MARKER, 1)[1].split("\n-->", 1)[0]) - if release["group"] != group or [p["sha"] for p in commit["parents"]] != [release["base_sha"]]: + if (release["group"] != group + or (line is not None and release.get("release_line") != line) + or [p["sha"] for p in commit["parents"]] != [release["base_sha"]]): raise RuntimeError("DDE 发布记录已改变,请先修复原基线 PR") + if group == "G2": + try: + started = datetime.datetime.strptime(release["started_at"], "%Y-%m-%dT%H:%M:%SZ") + except (KeyError, TypeError, ValueError) as error: + raise RuntimeError("DDE 本轮发布 started_at 缺失或无效") from error + if started.strftime("%Y-%m-%dT%H:%M:%SZ") != release["started_at"]: + raise RuntimeError("DDE 本轮发布 started_at 格式不符") return release if hops == 100 or len(commit["parents"]) != 2: break @@ -92,9 +168,7 @@ jobs: if not source: raise RuntimeError("PR 来源仓库已删除,无法校验") after = head_version(source["full_name"], pr["head"]["sha"]) - if before == after: - return "changelog 版本未变化" - if subprocess.run(["dpkg", "--compare-versions", after, "gt", before]).returncode: + if before != after and subprocess.run(["dpkg", "--compare-versions", after, "gt", before]).returncode: raise RuntimeError(f"成员版本只能升版: {before} -> {after}") owner = repo.split("/", 1)[0] @@ -102,25 +176,48 @@ jobs: default = api(f"repos/{baseline}")["default_branch"] cfg = yaml.safe_load(content(baseline, "groups.yaml", default)) groups = [g for g in cfg["groups"] if repo in repo_names(cfg, g, owner)] + if before == after and "G2" not in groups: + return "changelog 版本未变化" if len(groups) != 1: raise RuntimeError(f"{repo} 不属于唯一的 DDE 版本组,请核实分组配置") group = groups[0] - query = urlencode({"state": "all", "head": f"{owner}:baseline/{group}", + recipes = {} + line = None + branch = f"baseline/{group}" + baseline_version = cfg["groups"][group].get("version") + if group == "G2": + if "versions" in cfg["groups"][group]: + line = release_line(cfg, pr["base"]["ref"]) + branch = f"baseline/{line}/G2" + baseline_version = cfg["groups"][group]["versions"][line] + previous = linglong_versions(repo, pr["base"]["sha"]) + recipes = linglong_versions(source["full_name"], pr["head"]["sha"]) + removed = previous.keys() - recipes.keys() + if removed: + raise RuntimeError(f"G2 版本文件不能删除: {', '.join(sorted(removed))}") + for path, version in recipes.items(): + if (path in previous and version != previous[path] + and subprocess.run(["dpkg", "--compare-versions", version, "gt", + previous[path]]).returncode): + raise RuntimeError(f"G2 {path} 版本只能升版: {previous[path]} -> {version}") + if before == after and previous == recipes: + return "版本信息未变化" + query = urlencode({"state": "all", "head": f"{owner}:{branch}", "sort": "created", "direction": "desc", "per_page": 1}) prs = api(f"repos/{baseline}/pulls?{query}") if not prs: raise RuntimeError(f"{group} 没有统一发布记录,请从 DDE Release group 发起,不能单独改版") baseline_pr = prs[0] if (not baseline_pr["head"]["repo"] or baseline_pr["head"]["repo"]["full_name"] != baseline - or baseline_pr["head"]["ref"] != f"baseline/{group}" + or baseline_pr["head"]["ref"] != branch or baseline_pr["base"]["ref"] != default): raise RuntimeError("DDE 基线 PR 的来源或目标分支不符") - release = release_record(baseline, baseline_pr["head"]["sha"], group) + release = release_record(baseline, baseline_pr["head"]["sha"], group, line) if (release["base_branch"] != default - or [m["repo"] for m in release["members"]] != repo_names(cfg, group, owner)): + or [m["repo"] for m in release["members"]] != repo_names(cfg, group, owner) + or (line is not None and any(m["base"] != pr["base"]["ref"] for m in release["members"]))): raise RuntimeError("DDE 本轮成员或目标分支已改变,请先核实原发布") member = next(m for m in release["members"] if m["repo"] == repo) - baseline_version = cfg["groups"][group]["version"] if "version" in member: baseline_version = baseline_version.split(":", 1)[-1] if subprocess.run(["dpkg", "--compare-versions", release["version"], "ge", baseline_version]).returncode: @@ -135,6 +232,10 @@ jobs: if (after != target or source["full_name"] != repo or pr["head"]["ref"] != branch or pr["base"]["ref"] != member["base"] or pr["created_at"] < release["started_at"]): raise RuntimeError(f"{repo} 的改版 PR 不属于 {group} 本轮 {target},请从 DDE Release group 发起") + for path, version in recipes.items(): + # Update changelog 保留 Linglong 版本末尾的一个数字段。 + if not re.fullmatch(re.escape(target) + r"(?:\.[0-9]+)?", version): + raise RuntimeError(f"G2 {path} 版本 {version} 与本轮成员目标 {target} 不符") return f"{group} 本轮发布 {target},成员 PR 与发布记录一致" def identity(pr): @@ -170,6 +271,7 @@ jobs: - name: Publish version check result if: always() env: + GH_TOKEN: ${{ steps.release_token.outputs.token }} VERIFY_OUTCOME: ${{ steps.verify.outcome }} run: | set -euo pipefail diff --git a/repos/linuxdeepin/dde-api.json b/repos/linuxdeepin/dde-api.json index 36a3eba72..127acf32c 100644 --- a/repos/linuxdeepin/dde-api.json +++ b/repos/linuxdeepin/dde-api.json @@ -69,15 +69,19 @@ "dest": "linuxdeepin/dde-api/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-api/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-api/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/dde-appearance.json b/repos/linuxdeepin/dde-appearance.json index 31d1241ec..349bc3030 100644 --- a/repos/linuxdeepin/dde-appearance.json +++ b/repos/linuxdeepin/dde-appearance.json @@ -59,15 +59,19 @@ "dest": "linuxdeepin/dde-appearance/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-appearance/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-appearance/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/dde-application-manager.json b/repos/linuxdeepin/dde-application-manager.json index 9945a332f..ac7c3cbed 100644 --- a/repos/linuxdeepin/dde-application-manager.json +++ b/repos/linuxdeepin/dde-application-manager.json @@ -59,15 +59,19 @@ "dest": "linuxdeepin/dde-application-manager/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-application-manager/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-application-manager/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/dde-control-center.json b/repos/linuxdeepin/dde-control-center.json index 7aa19ea42..90b75bfdd 100644 --- a/repos/linuxdeepin/dde-control-center.json +++ b/repos/linuxdeepin/dde-control-center.json @@ -85,15 +85,19 @@ "dest": "linuxdeepin/dde-control-center/.github/workflows/call-deploy-dev-doc.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-control-center/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-control-center/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/dde-daemon.json b/repos/linuxdeepin/dde-daemon.json index 3685d2b55..e4d1d92cd 100644 --- a/repos/linuxdeepin/dde-daemon.json +++ b/repos/linuxdeepin/dde-daemon.json @@ -69,15 +69,19 @@ "dest": "linuxdeepin/dde-daemon/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-daemon/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-daemon/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/dde-launchpad.json b/repos/linuxdeepin/dde-launchpad.json index 08ed4b0e8..559d0a80c 100644 --- a/repos/linuxdeepin/dde-launchpad.json +++ b/repos/linuxdeepin/dde-launchpad.json @@ -71,15 +71,19 @@ "dest": "linuxdeepin/dde-launchpad/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-launchpad/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-launchpad/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/dde-network-core.json b/repos/linuxdeepin/dde-network-core.json index e66610d6c..08992c18a 100644 --- a/repos/linuxdeepin/dde-network-core.json +++ b/repos/linuxdeepin/dde-network-core.json @@ -90,15 +90,19 @@ "dest": "linuxdeepin/dde-network-core/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-network-core/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-network-core/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/dde-services.json b/repos/linuxdeepin/dde-services.json index 42b291439..d4e6ef8e1 100644 --- a/repos/linuxdeepin/dde-services.json +++ b/repos/linuxdeepin/dde-services.json @@ -1,14 +1,18 @@ [ { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-services/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-services/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/dde-session-shell-snipe.json b/repos/linuxdeepin/dde-session-shell-snipe.json index bf6fbeb3d..2f902d79d 100644 --- a/repos/linuxdeepin/dde-session-shell-snipe.json +++ b/repos/linuxdeepin/dde-session-shell-snipe.json @@ -1,14 +1,18 @@ [ { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-session-shell-snipe/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-session-shell-snipe/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/dde-session.json b/repos/linuxdeepin/dde-session.json index 80d192d93..49c576450 100644 --- a/repos/linuxdeepin/dde-session.json +++ b/repos/linuxdeepin/dde-session.json @@ -59,15 +59,19 @@ "dest": "linuxdeepin/dde-session/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-session/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-session/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/dde-shell.json b/repos/linuxdeepin/dde-shell.json index 48a8f132a..420e9ad95 100644 --- a/repos/linuxdeepin/dde-shell.json +++ b/repos/linuxdeepin/dde-shell.json @@ -71,15 +71,19 @@ "dest": "linuxdeepin/dde-shell/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-shell/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-shell/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/dde-tray-loader.json b/repos/linuxdeepin/dde-tray-loader.json index b8a5a6c56..27dbb6af7 100644 --- a/repos/linuxdeepin/dde-tray-loader.json +++ b/repos/linuxdeepin/dde-tray-loader.json @@ -52,15 +52,19 @@ "dest": "linuxdeepin/dde-tray-loader/.github/workflows/call-auto-tag.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/dde-tray-loader/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/dde-tray-loader/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/deepin-service-manager.json b/repos/linuxdeepin/deepin-service-manager.json index 4092839a5..66e49943a 100644 --- a/repos/linuxdeepin/deepin-service-manager.json +++ b/repos/linuxdeepin/deepin-service-manager.json @@ -84,15 +84,19 @@ "dest": "linuxdeepin/deepin-service-manager/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/deepin-service-manager/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/deepin-service-manager/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/deepin-update-ui.json b/repos/linuxdeepin/deepin-update-ui.json index 2e14657bc..a8aebc52c 100644 --- a/repos/linuxdeepin/deepin-update-ui.json +++ b/repos/linuxdeepin/deepin-update-ui.json @@ -62,15 +62,19 @@ "dest": "linuxdeepin/deepin-update-ui/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/deepin-update-ui/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/deepin-update-ui/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/go-dbus-factory.json b/repos/linuxdeepin/go-dbus-factory.json index 8498ac6ec..bf4190754 100644 --- a/repos/linuxdeepin/go-dbus-factory.json +++ b/repos/linuxdeepin/go-dbus-factory.json @@ -59,8 +59,10 @@ "dest": "linuxdeepin/go-dbus-factory/.github/workflows/call-auto-tag.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/go-dbus-factory/.github/workflows/call-update-changelog.yml" @@ -77,7 +79,9 @@ }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/go-dbus-factory/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/go-lib.json b/repos/linuxdeepin/go-lib.json index 1ee1b4db0..26a6e8b45 100644 --- a/repos/linuxdeepin/go-lib.json +++ b/repos/linuxdeepin/go-lib.json @@ -69,15 +69,19 @@ "dest": "linuxdeepin/go-lib/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/go-lib/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/go-lib/.github/workflows/call-verify-group-version.yml" diff --git a/repos/linuxdeepin/xdg-desktop-portal-dde.json b/repos/linuxdeepin/xdg-desktop-portal-dde.json index dc62acbaf..e58b3aeb0 100644 --- a/repos/linuxdeepin/xdg-desktop-portal-dde.json +++ b/repos/linuxdeepin/xdg-desktop-portal-dde.json @@ -59,15 +59,19 @@ "dest": "linuxdeepin/xdg-desktop-portal-dde/.github/workflows/call-tag-build.yml" }, { - "branch": [ - "master" + "branches": [ + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-update-changelog.yml", "dest": "linuxdeepin/xdg-desktop-portal-dde/.github/workflows/call-update-changelog.yml" }, { "branches": [ - "master" + "master", + "develop/.+", + "release/.+" ], "src": "workflow-templates/call-verify-group-version.yml", "dest": "linuxdeepin/xdg-desktop-portal-dde/.github/workflows/call-verify-group-version.yml" diff --git a/workflow-templates/call-verify-group-version.yml b/workflow-templates/call-verify-group-version.yml index 1ccd0603b..1f4949ab2 100644 --- a/workflow-templates/call-verify-group-version.yml +++ b/workflow-templates/call-verify-group-version.yml @@ -12,3 +12,4 @@ permissions: jobs: verify: uses: linuxdeepin/.github/.github/workflows/verify-group-version.yml@master + secrets: inherit