Skip to content

Cannot read properties of undefined (reading 'number') #2790

Closed
@stevelacey

Description

@stevelacey

Subject of the issue

I started getting this error on v4, so upgraded to v6, but I'm still seeing it 🤔

Create or update the pull request
  Attempting creation of pull request
  A pull request already exists for example:branch
  Fetching existing pull request
  Attempting update of pull request
  Error: Cannot read properties of undefined (reading 'number')

Seems to only happen when there's an existing pull request, if I delete the existing one the workflow will succeed.

Steps to reproduce

Run the workflow with an existing pull request present.

    - uses: peter-evans/create-pull-request@v6
      with:
        title: Release ${{ inputs.next_version }}
        body: |
          ## Release [${{ inputs.next_version }}](${{ github.server_url }}/${{ github.repository }}/compare/${{ inputs.previous_version }}...${{ steps.commit.outputs.short }})

          ${{ inputs.notes }}
        author: GitHub <[email protected]>
        branch: release
        committer: GitHub <[email protected]>
        commit-message: |
          chore(release): ${{ inputs.next_version }}
        delete-branch: true

https://github.com/stevelacey/release-builder/blob/v1/pull-request/action.yml#L27C25-L39

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions