Skip to content

Error: Cannot read properties of null (reading 'name') #488

@cristianpaul0

Description

@cristianpaul0

Getting:

1s
Run xt0rted/pull-request-comment-branch@v3
  with:
    repo_token: ***
Error: Cannot read properties of null (reading 'name')

From the following cofig

name: Issue Comment Workflow

on:
  issue_comment:
    types: [created]

jobs:
  handle_issue_comment:
    runs-on: [self-hosted, staging]

    steps:

      - name: Check comment content
        id: check_comment
        run: |
          if [[ "${{ github.event.comment.body }}" != *"deploy to staging"* ]]; then
            echo "Comment does not contain trigger keyword"
            exit 1
          fi
      - uses: xt0rted/pull-request-comment-branch@v3
        id: comment-branch

      - uses: actions/checkout@v3
        if: success()
        with:
          ref: ${{ steps.comment-branch.outputs.head_ref }}

Cant figure why with some PR it works fine and with others dont

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