Skip to content

Unexpected token '}' error #26

@kratsg

Description

@kratsg

Hi, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions