Unexpected token '}' error
See original GitHub issueHi, thanks for the very useful GHA tool here. The following error is seen here:
SyntaxError: Unexpected token '}'
at new AsyncFunction (<anonymous>)
at main (/home/runner/work/_actions/actions/github-script/0.3.0/main.js:19:14)
at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/0.3.0/main.js:5:1)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11
##[error]Unexpected token '}'
##[error]Node run failed with exit code 1
but it’s not clear what’s going wrong, since it looks correctly written (and has worked in other repositories just fine). We have a step that looks like so:
- name: Comment that something failed
if: failure()
uses: actions/github-script@0.3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({...context.issue, body: ":cry: Something went wrong. I am not able to push. Check the [Actions pipeline](https://github.com/${{ github.repository }}/actions?query=workflow%3A%22Tag+Creator%22) to see what happened. If you make any more changes, you probably want to re-trigger me again by adding the `bumpversion/${{ env['BV_PART'] }}` label again."})
github.issues.removeLabels({...context.issue, "bumpversion/${{ env['BV_PART'] }}" })
with the following env:
env:
IS_MAJOR: false
IS_MINOR: false
IS_PATCH: true
PR_NUMBER: 38
PR_TITLE: Revert "Revert "ci: Add release via bumpversion tag GHA workflow""
GITHUB_HEAD_REF: revert-36-revert-35-ci-add-publishing-throuhg-bumpversion-label
BV_PART: patch
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
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 >How to fix: "SyntaxError: Unexpected token" in JavaScript
One common cause of the SyntaxError: Unexpected token error is a missing semicolon. In JavaScript, semicolons are used to indicate the end of...
Read more >syntax error: unexpected token - javascript - Stack Overflow
The error SyntaxError: Unexpected token < likely means the API endpoint didn't return JSON in its document body, such as due to a...
Read more >SyntaxError: Unexpected token in JavaScript - Stack Diary
The "SyntaxError: Unexpected token" error in JavaScript is a common syntax error that occurs when the JavaScript interpreter encounters a ...
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

@kratsg The key is
name—that’s the key being used in the documentation and in my example (though you may have seen it before I updated it to match the documentation).In this JavaScript object:
The keys are
owner,repo,issue_number, andnamewhose values are variables of the same names. The documentation is using ES6 property/value shorthand.Hi All,
I am getting a similar error when I do: … - name: Terraform Init run: terraform -chdir=./src/infra init …
`Run terraform -chdir=./src/infra init /home/github-runner-elsa/actions-runner/_work/_temp/xxxxx-ab34-afa9f59e47e1/terraform:75 function cp(source, dest, options = {}) { ^
SyntaxError: Unexpected token = at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:374:25) at Object.Module._extensions…js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Function.Module.runMain (module.js:442:10) at startup (node.js:136:18) at node.js:966:3 Error: Process completed with exit code 1.`
My workflow Infrastructure.yaml is :
`name: Infrastructure
on: workflow_dispatch: push: branches: - ‘main’ paths: - ‘src/infra/’ pull_request: branches: - ‘main’ paths: - 'src/infra/’
env: ARM_CLIENT_ID: ${{secrets.INFRA_TF_CLIENT_ID}} ARM_CLIENT_SECRET: ${{secrets.INFRA_TF_CLIENT_SECRET}} ARM_SUBSCRIPTION_ID: ${{secrets.INFRA_TF_SUBSCRIPTION_ID}} ARM_TENANT_ID: ${{secrets.INFRA_TF_TENANT_ID}} TF_VAR_location: westeurope
jobs: terraform_dev: runs-on: self-hosted #environment: dev
terraform_prd: runs-on: self-hosted #environment: prd if: github.ref == ‘refs/heads/main’ needs: terraform_dev
I have a self hosted linux runner and I am using Github Enterprise server.
On my runner VM, i have also did the following, but no luck:
apt update apt install nodejs ln -s /usr/bin/nodejs /usr/local/bin/nodeIt seems the node version installed on the runner is newer than the one expected to build the pipe? if true, which node version do i need on my runner? terraform init requires node?
Thanks.