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

[Bug] Cannot read property '_links' of undefined #42

Open
iwfan opened this issue Apr 24, 2021 · 1 comment
Open

[Bug] Cannot read property '_links' of undefined #42

iwfan opened this issue Apr 24, 2021 · 1 comment
Labels
status: pinned Should not be labeled as stale type: bug Verified problems that need to be worked on

Comments

@iwfan
Copy link

iwfan commented Apr 24, 2021

It's failed when I first use this version-check action.

image

It looks like the problem is happening here

(await request(eventObj.pull_request._links.commits.href))

Here is my Github action config file:

name: Auto-publish

on:
  release:
    # This specifies that the build will be triggered when we publish a release
    types: [published]

jobs:
  check_version:
    name: Check version
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ref: main

      - name: Check version changes
        uses: EndBug/version-check@v1
        id: version
        with:
          diff-search: true

      - name: Check version status
        if: steps.version.outputs.changed == 'true'
        run: |
          echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.type }})"
    outputs:
      version: ${{ steps.version.outputs.version }}
      version_changed: ${{ steps.version.outputs.changed }}

  build:
    name: Build
    needs: check_version
    if: needs.check.outputs.version_changed == 'true'
    runs-on: ubuntu-latest
    env:
      HUSKY: 0
    steps:
      - uses: actions/checkout@v2
        with:
          ref: main

      - name: Use Node.js 14.16.1
        uses: actions/setup-node@v1
        with:
          node-version: 14.16.1
          registry-url: https://registry.npmjs.org/

      - name: Cache pnpm modules
        uses: actions/cache@v2
        env:
          cache-name: cache-pnpm-modules
        with:
          path: ~/.pnpm-store
          key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
          restore-keys: |
            ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
      - uses: pnpm/action-setup@v2.0.0
        with:
          version: 6.0.2
          run_install: |
            - recursive: true
              args: [--frozen-lockfile, --strict-peer-dependencies]
      - name: run lint & test & build
        run: |
          pnpm run lint
          pnpm run test
          pnpm run build
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v1
        with:
          token: ${{secrets.CODECOV_TOKEN}}

      - name: upload artifact
        uses: actions/upload-artifact@main
        with:
          name: artifacts
          path: dist/
          retention-days: 5
          if-no-files-found: error

  publish:
    needs: build
    environment: npm-publish
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ref: main

      - name: Use Node.js 14.16.1
        uses: actions/setup-node@v1
        with:
          node-version: 14.16.1

      - name: download artifact
        uses: actions/download-artifact@main
        with:
          name: artifacts
          path: dist

      - name: publish to npm
        run: |
          cd dist
          # upgrade npm version in package.json to the tag used in the release.
          echo //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN > .npmrc
          npm publish --access public
        env:
          # Use a token to publish to NPM. See below for how to set it up
          NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
@iwfan iwfan added the status: pending More info is needed before deciding what to do label Apr 24, 2021
@EndBug
Copy link
Owner

EndBug commented Apr 24, 2021

Hi, thanks for the report. I'm working on a rewrite so this will probably be solved by that. I hope I can finish it in the near future.

@EndBug EndBug added status: pinned Should not be labeled as stale type: bug Verified problems that need to be worked on and removed status: pending More info is needed before deciding what to do labels Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pinned Should not be labeled as stale type: bug Verified problems that need to be worked on
Projects
None yet
Development

No branches or pull requests

2 participants