Skip to content

fix: repair invalid yaml in issue close workflow - #2952

Merged
crazylxr merged 1 commit into
masterfrom
fix/issue-close-require-yaml
Aug 5, 2026
Merged

fix: repair invalid yaml in issue close workflow#2952
crazylxr merged 1 commit into
masterfrom
fix/issue-close-require-yaml

Conversation

@crazylxr

@crazylxr crazylxr commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

问题

合并 PR #2946 时 GitHub 报错:

Invalid workflow file
You have an error in your yaml syntax on line 25 in .github/workflows/issue-close-require.yml

原因

提交 0df187e(经 PR #2941 合入)把 workflow 重写为 actions/github-script@v7 版本,其中两处 body 的中文续行写成了零缩进(顶格)。这导致 YAML 的 script: | 字面量块标量提前结束,后面的 }, 被当作 YAML 结构解析,触发语法错误(line 25)。

修复

将两处多行模板字符串改为单行 JS 字符串 + \n 换行,彻底避免多行 YAML 标量的缩进陷阱:

body: 'Since the issue was labeled with `🤔 Need Reproduce`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.\n由于该 issue 被标记为需要重现(🤔 Need Reproduce),却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。',

已通过 ruby -ryaml 解析校验,YAML OK。

该分支基于最新 origin/master(含 PR #2946 的合并),无冲突。

The Chinese continuation lines in the github-script body were written
with zero indentation, which terminated the 'script: |' literal block
scalar early and made the workflow file invalid YAML. Use single-line
JS strings joined with \n instead of multi-line template literals.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@pkg-pr-new

pkg-pr-new Bot commented Aug 5, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ahooks@2952
npm i https://pkg.pr.new/@ahooks.js/use-url-state@2952

commit: 2652748

@crazylxr
crazylxr merged commit bb42f8f into master Aug 5, 2026
17 of 18 checks passed
@crazylxr
crazylxr deleted the fix/issue-close-require-yaml branch August 5, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants