Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: GitHub is not a constructor when using v2 #35

Open
ibexa-yuna opened this issue Apr 20, 2023 · 1 comment
Open

TypeError: GitHub is not a constructor when using v2 #35

ibexa-yuna opened this issue Apr 20, 2023 · 1 comment

Comments

@ibexa-yuna
Copy link

Hi,

I'm using this action and when I'm upgrading the action from v1 to v2 tag, I'm getting an error.

const octokit = new GitHub(process.env.GITHUB_TOKEN);
                ^

TypeError: GitHub is not a constructor
    at Object.760 (/home/runner/work/_actions/zendesk/action-create-release/v2/dist/index.js:7931:17)
    at __webpack_require__ (/home/runner/work/_actions/zendesk/action-create-release/v2/dist/index.js:22:30)
    at Object.31 (/home/runner/work/_actions/zendesk/action-create-release/v2/dist/index.js:205:13)
    at __webpack_require__ (/home/runner/work/_actions/zendesk/action-create-release/v2/dist/index.js:22:30)
    at startup (/home/runner/work/_actions/zendesk/action-create-release/v2/dist/index.js:37:19)
    at /home/runner/work/_actions/zendesk/action-create-release/v2/dist/index.js:41:18
    at Object.<anonymous> (/home/runner/work/_actions/zendesk/action-create-release/v2/dist/index.js:44:10)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)

I'm invoking action as follows:

        id: create_release
        uses: zendesk/action-create-release@v2
        with:
          tag_name: ${{ env.BUILD_TAG }}
          body: |
            ${{ env.CHANGELOG_OUTPUT }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I'm using standard github-hosted runner, nothing special.

@fiddlermikey
Copy link

I am having the same issue

With v2 I get the same results above. I am using the example workflow usage from the main page on a standard ubuntu runner.

name: "Release Tests"
on:
  workflow_dispatch
jobs:
  build:
    name: Create Release
    runs-on: ubuntu-latest
    steps:
      - name: Create Release
        id: create_release
        uses: zendesk/action-create-release@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
        with:
          tag_name: ${{ github.ref }}
          release_name: Release ${{ github.ref }}
          body: |
            Changes in this Release
            - First Change
            - Second Change
          draft: false
          prerelease: false

With v1 I get the following:

Error: Resource not accessible by integration

Followed by the warning about node12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants