phips28 / gh-action-bump-version

GitHub Action for automated npm version bump.
MIT License
336 stars 249 forks source link

property map undefined #26

Closed lucascebertin closed 4 years ago

lucascebertin commented 4 years ago

Hello, I'm getting this error message when running this example on my private repo

 Automated Version Bump
    at Module._compile (internal/modules/cjs/loader.js:1201:30)
Run phips28/gh-action-bump-version@master
/usr/bin/docker run --name c20142dd32f8ea2a42b69f5cb2059f596a90_ee73bc --label 87c201 --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_TAG-PREFIX -e INPUT_PACKAGEJSON_DIR -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/discord-tibia-bot/discord-tibia-bot":"/github/workspace" 87c201:42dd32f8ea2a42b69f5cb2059f596a90
✖  fatal     TypeError: Cannot read property 'map' of undefined 
    at /index.js:15:34
    at Function.<anonymous> (/node_modules/actions-toolkit/lib/index.js:109:31)
    at step (/node_modules/actions-toolkit/lib/index.js:43:23)
    at Object.next (/node_modules/actions-toolkit/lib/index.js:24:53)
    at /node_modules/actions-toolkit/lib/index.js:18:71
    at new Promise (<anonymous>)
    at __awaiter (/node_modules/actions-toolkit/lib/index.js:14:12)
    at Function.Toolkit.run (/node_modules/actions-toolkit/lib/index.js:100:16)
    at Object.<anonymous> (/index.js:11:9)
    at Module._compile (internal/modules/cjs/loader.js:1201:30)

Reading the code at index.js:15:34, looks like the event could not find any commit messages... it's weird Don't know if I'm doing something wrong here.

My CI action looks like this:

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [10.x]

    steps:
    # Step for build/test
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm ci
    - run: npm run build --if-present
    - run: npm test

    # Step for automatic bump version
    - name: "Checkout source code"
      uses: "actions/checkout@v2"
      with:
        ref: ${{ github.ref }}
    - name: "cat package.json"
      run: cat ./package.json
    - name: "Setup Node.js"
      uses: "actions/setup-node@v1"
      with:
        node-version: 12
    - name: "Automated Version Bump"
      uses: "phips28/gh-action-bump-version@master"
      with:
        tag-prefix: ''
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    - name: "cat package.json"
      run: cat ./package.json

Could anyone help me with that? Am I missing something? Maybe some additional config?

Thanks!

Chili-Man commented 4 years ago

I'm running into the same issue as well, with version 7.1.0 (e4fe6b545483e60586342bccdd9078e1c4d4d49a)

Chili-Man commented 4 years ago

@lucascebertin I believed I figured out the issue; you'll get that error message when its running under a pull request, thats why the map is undefined.

phips28 commented 4 years ago

Can you try again? should be fixed by PR: https://github.com/phips28/gh-action-bump-version/pull/39