Files
MemRelay/global/Gitea 批量创建 issue 与 #n 引用链接.md
T
memrelay fa50be02dc create: Gitea 批量创建 issue 与 #n 引用链接
MemRelay-Operation: memory-save:global-exp-gitea-bulk-issues-20260930-a1
MemRelay-Resource: 7bf4d88e-2e2d-48bf-9d0c-9f85cf89c60d
2026-09-30 14:04:15 +08:00

29 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 'Gitea 批量创建 issue 与 #n 引用链接'
type: experience
permalink: main/global/gitea-批量创建-issue-与-n-引用链接
stable_id: 7bf4d88e-2e2d-48bf-9d0c-9f85cf89c60d
scope: global
memory_type: experience
project_id: null
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
status: active
revision: 1
request_id: global-exp-gitea-bulk-issues-20260930-a1
created_at: '2026-09-30T06:04:10.405927+00:00'
updated_at: '2026-09-30T06:04:10.405927+00:00'
tags:
- gitea
- issues
- api
- markdown
---
- issue 正文按评论模式渲染。#n 只有在前面是空白、行首或半角 ( [ 时才会自动链接;全角括号「(#8)」不会链接,要写成「 (#8)」。
- 可以用 POST /api/v1/markdown(Mode=comment,Context=仓库完整 URL)预先验证渲染效果;Mode=gfm 不解析 issue 引用。
- 批量建 issue 的稳妥流程:
1. 凭据用 git credential fill 取出后拼 Basic auth,不写进命令行或文件。
2. 每建一个 issue 就把「编号→issue 号」落盘,脚本可以幂等重跑。
3. 先建占位总览拿到编号,再建各子 issue,最后二次 PATCH 回填依赖编号和总览表格。
4. 改写已有 issue 前,先把原正文保存到本地;新正文里用 details 折叠保留原文。
- 仓库没有任何标签时,GET /labels 可能返回 null,需要先过滤空值。