Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

SyntaxError: Unexpected identifier 'URL' when updating PR content with @v7 (Previously Working)

未关闭
#622 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
github-actions, javascript, typescript
领域
ci-cd, devops

调研方向

Start with .github/workflows/pr-release.yml lines 104-119 in the linked repository and reproduce the failing run using actions/github-script@v6 and @v7. Compare the workflow script with the reported AsyncFunction stack traces in the run logs. Done means the cause of the SyntaxError is identified and the workflow can update the pull request content successfully.

由索引模型根据 Issue 内容生成。

描述

I'm encountering a SyntaxError: Unexpected identifier 'URL' when attempting to update PR content using actions/github-script@v7. This specific script was working correctly in previous runs and has only recently started failing.

My Repository: https://github.com/tangcent/easy-yapi
Relevant Workflow File: https://github.com/tangcent/easy-yapi/blob/d00f1af4a406766a020d0da822975ba33542cdd7/.github/workflows/pr-release.yml#L104-L119
Failing Workflow Run: https://github.com/tangcent/easy-yapi/actions/runs/15807636615/job/44554634082?pr=1252
Error Details from Workflow Log:

Run actions/github-script@v7
SyntaxError: Unexpected identifier 'URL'
    at new AsyncFunction (<anonymous>)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:354[24](https://github.com/tangcent/easy-yapi/actions/runs/15807636615/job/44554634082?pr=1252#step:6:25):16)
    at main (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35522:[26](https://github.com/tangcent/easy-yapi/actions/runs/15807636615/job/44554634082?pr=1252#step:6:27))
    at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35497:1
    at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35553:3
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35556:12)
    at Module._compile (node:internal/modules/cjs/loader:1529:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
    at Module.load (node:internal/modules/cjs/loader:1[27](https://github.com/tangcent/easy-yapi/actions/runs/15807636615/job/44554634082?pr=1252#step:6:28)5:32)
    at Module._load (node:internal/modules/cjs/loader:1096:12)
Error: Unhandled error: SyntaxError: Unexpected identifier 'URL'

I initially observed this error with @v7, and, to troubleshoot, I also tried using actions/github-script@v6, but it produced the exact same SyntaxError:

Run actions/github-script@v6
SyntaxError: Unexpected identifier 'URL'
    at new AsyncFunction (<anonymous>)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15143:16)
    at main (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15236:[26](https://github.com/tangcent/easy-yapi/actions/runs/15807636615/job/44554634082?pr=1252#step:6:27))
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:15217:1
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:15268:3
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15[27](https://github.com/tangcent/easy-yapi/actions/runs/15807636615/job/44554634082?pr=1252#step:6:28)1:12)
    at Module._compile (node:internal/modules/cjs/loader:1529:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
    at Module.load (node:internal/modules/cjs/loader:1275:32)
    at Module._load (node:internal/modules/cjs/loader:1096:12)
Error: Unhandled error: SyntaxError: Unexpected identifier 'URL'

I've tried to debug the issue by cloning this repository, but I haven't been able to pinpoint the cause of this error. Any assistance would be greatly appreciated.

主要语言
TypeScript
星标
5k
派生
586
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

actions/github-script 的其他 Issue

查看 actions/github-script 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。