Skip to content

TypeError: Cannot read properties of null (reading state) #39

@Ariastarcos

Description

@Ariastarcos

Hi there!

I followed this guide to authorize the action through a GitHub App with the following combine-prs.yml:

name: Combine PRs

on:
  workflow_dispatch: # allows you to manually trigger the workflow

# The minimum permissions required to run this Action
permissions:
  contents: write # to create a new branch and merge other branches together
  pull-requests: write # to create a new PR with the combined changes
  checks: read # to check if CI is passing or not before combining PRs

jobs:
  combine-prs:
    runs-on: ubuntu-latest

    steps:
      - name: Use GitHub App Token
        uses: wow-actions/use-app-token@d7957e08172ca2e8e49b35b8d266ad585885edc7 # pin@v2.0.2
        id: generate_token
        with:
          app_id: ${{ secrets.COMBINE_PRS_APP_ID }} # The ID of the GitHub App
          private_key: ${{ secrets.COMBINE_PRS_PRIVATE_KEY }} # The private key of the GitHub App
          fallback: ${{ secrets.GITHUB_TOKEN }} # fall back to the default token if the app token is not available

      - name: combine-prs
        uses: github/combine-prs@v4.0.0 # where X.X.X is the latest version
        with:
          github_token: ${{ steps.generate_token.outputs.BOT_TOKEN }} # A GitHub app token generated by the previous step

The Use GitHub App Token step is successful, but the combine-prs step is erroring with the following trace:

/home/runner/work/_actions/github/combine-prs/v4.0.0/webpack:/combine-prs-action/src/functions/check-status.js:40
      const state = commit.statusCheckRollup.state
^
TypeError: Cannot read properties of null (reading 'state')
    at checkStatus (/home/runner/work/_actions/github/combine-prs/v4.0.0/webpack:/combine-prs-action/src/functions/check-status.js:40:1)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at run (/home/runner/work/_actions/github/combine-prs/v4.0.0/webpack:/combine-prs-action/src/main.js:80:1)

Probably something silly I'm missing here, but would love a nudge in the right direction to resolving this 🙏

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions