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: Cannot read property 'map' of undefined #24

Open
cicciodifranco opened this issue Dec 23, 2020 · 6 comments
Open

TypeError: Cannot read property 'map' of undefined #24

cicciodifranco opened this issue Dec 23, 2020 · 6 comments

Comments

@cicciodifranco
Copy link

When I try to use this action with pull_request

on:
  pull_request:
    types: [closed]
    branches: [master]

I receive this error

TypeError: Cannot read property 'map' of undefined
@finsterdexter
Copy link

finsterdexter commented Jan 12, 2021

Until they add proper support for pull_request, you can workaround like so:

  with:
    string: ${{ github.event.pull_request.title }}

@brennerm
Copy link

FYI You can workaround this bug by setting an empty string for the from input:

- uses: atlassian/[email protected]
  with:
    string: ${{ github.event.pull_request.title }}
    from: ""

@SudKul
Copy link

SudKul commented Mar 28, 2021

Hi All,
I am also facing the same error:

Run atlassian/gajira-find-issue-key@master
  with:
    from: commits
Error: TypeError: Cannot read property 'map' of undefined

Is this a valid way to fetch PR object's data? I want to fetch the PR number, title, and description.

    - name: Find in commit messages
      uses: atlassian/gajira-find-issue-key@master
      with:
        from: commits
${{ github.event.pull_request.number }} 
${{ github.event.pull_request.title }}  
${{ github.event.pull_request.description }}

Thanks in advance.

@xakraz
Copy link

xakraz commented Sep 2, 2021

Any hope to see a fix ?
🙏🏻

@sshaw
Copy link

sshaw commented Jan 6, 2022

Having this problem when trying to get the ID from commits when PR is merged. The variables used by this action are blank in this context.

As I fix I did the following which gets the ID from the PR's branch:

- uses: atlassian/[email protected]
  id: find_jira_issue
  with:
    string: ${{ github.head_ref }}

You may be able to do the same with commits via string: ${{ github.event.commits.map(c=>c.message).join(' ') }} but I did not test this. :octocat:

@Ahmed-Salama96
Copy link

Any hope to see a fix ?
🙏🏻

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

7 participants