Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Error: Unhandled error: SyntaxError: Invalid or unexpected token#413

Unanswered
JawadZein asked this question inQ&A
Discussion options

Hi!

In this block of code I'm getting an error in GitHub workflow

  • name: Create GitHub Issue
    uses: actions/github-script@v6
    with:
    github-token: ${{ secrets.GitHub_TOKEN }}
    script: |
    const fs = require('fs');
    const emailContents = fs.readFileSync('/home/runner/work/demo_test/demo_test/scripts/email_contents.txt', 'utf8');
    const issueTitle = 'New Issue from Email';
    const issueBody = 'emailContents';

          async function createGitHubIssue() {       # Create an issue using the GitHub API      const response = await github.issues.create({      owner: 'context.repo.owner',      repo: 'context.repo.repo',      title: 'issueTitle',      body: 'issueBody'      });                 console.log('Issue created:', response.data);      }      createGitHubIssue()      user-agent: actions/github-script      result-encoding: json      debug: false                 retries: 0      retry-exempt-status-codes: 400,401,403,404,422

Error :

Run actions/github-script@v6
SyntaxError: Invalid or unexpected token
at new AsyncFunction ()
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)
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. (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15271:12)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
Error: Unhandled error: SyntaxError: Invalid or unexpected token
at Function.Module._load (node:internal/modules/cjs/loader:911:12)

Thanks

You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@JawadZein

[8]ページ先頭

©2009-2025 Movatter.jp