Error: Unhandled error: SyntaxError: Invalid or unexpected token
See original GitHub issueDescribe the bug
Error: Unhandled error: SyntaxError: Invalid or unexpected token
To Reproduce
Run actions/github-script@v3.1.0
with:
script: await github.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
head: prepare-release,
base: main,
title: 'chore(release): :bookmark: release v1.0.4',
body: '
### Bug Fixes
- **actions:** 🐛 fix not found branch ([25b4e19](https://github.com/yi-Xu-0100/test/commit/25b4e1926a26dca753a2b6bb8627881f47941428))
- fix push error ([62458bf](https://github.com/yi-Xu-0100/test/commit/62458bf2fede7fe842cd9176cec6920a339469d8))',
maintainer_can_modify: true,
})
github-token: ***
debug: false
user-agent: actions/github-script
result-encoding: json
env:
BASE_BRANCH: main
HEAD_BRANCH: prepare-release
SyntaxError: Invalid or unexpected token
at new AsyncFunction (<anonymous>)
at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v3.1.0/dist/index.js:5368:56)
Error: Unhandled error: SyntaxError: Invalid or unexpected token
at main (/home/runner/work/_actions/actions/github-script/v3.1.0/dist/index.js:5394:26)
at Module.720 (/home/runner/work/_actions/actions/github-script/v3.1.0/dist/index.js:5378:1)
at __webpack_require__ (/home/runner/work/_actions/actions/github-script/v3.1.0/dist/index.js:24:31)
at startup (/home/runner/work/_actions/actions/github-script/v3.1.0/dist/index.js:43:19)
at /home/runner/work/_actions/actions/github-script/v3.1.0/dist/index.js:49:18
at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v3.1.0/dist/index.js:52:10)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
SyntaxError: Unexpected token - JavaScript - MDN Web Docs
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided.
Read more >Uncaught SyntaxError: Invalid or unexpected token
I am a beginner so I get stuck in syntax a lot. If it is that then please help me out. javascript ·...
Read more >Have a JavaScript Unexpected Token Error? Check Your Syntax
The JavaScript's parser expects tokens and symbols in a particular order, with relevant values or variables in between. Often, an Unexpected ...
Read more >JavaScript Error Handling: Unexpected Token - GeeksforGeeks
Not follow them throws an error.An unexpected token occurs if JavaScript code has a missing or extra character { like, ) + –...
Read more >JavaScript SyntaxError: Invalid or unexpected token ... - IBM
Why? Because the stack trace you see is the result of an global/uncaught error being rethrown, thereby losing the original stack. Open Chrome...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
thanks for pointing out that article, the change between the pull_request and pull_request_target events was what was affecting us
👍 Thanks @yi-Xu-0100, glad to hear it’s working fine.
@TiKevin83 feel free to file a new issue with an example workflow or run hitting this issue.
If you started having issues in early March and it’s only affecting Dependabot workflows, you may be impacted by the changes we made to limit Dependabot to read-only access, see https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/ for more information.