Description
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.