Skip to content

Conversation

@capthiron
Copy link
Contributor

This is related to #39.

This commit addresses a TypeError that occurs when trying to access the 'state' property of 'commit.statusCheckRollup' when it is null. A conditional check is added to ensure 'commit.statusCheckRollup' is not null before attempting to access 'state'. This prevents the TypeError and provides a more informative message when 'commit.statusCheckRollup' is null.

However, this would not solve the underlying issue of why commit.statusCheckRollup is null when it shouldn't be (see #39).

Also, if commit.statusCheckRollup being null is a valid state that indicates a certain condition (e.g., the CI status check has not been run yet), then the logic within checkStatus() may need to be updated to handle this condition appropriately.

This commit addresses a TypeError that occurs when trying to access the 'state' property of 'commit.statusCheckRollup' when it is null. A conditional check is added to ensure 'commit.statusCheckRollup' is not null before attempting to access 'state'. This prevents the TypeError and provides a more informative message when 'commit.statusCheckRollup' is null.
@capthiron capthiron requested a review from GrantBirki as a code owner October 19, 2023 15:13
@capthiron
Copy link
Contributor Author

capthiron commented Oct 20, 2023

After further investigation into the Github GraphQL API, I have discovered that the commit.statusCheckRollup field is indeed nullable. This means that there are valid scenarios where this field can be null. This could occur if the commit does not have any status checks associated with it.

Therefore these changes should at least help improving the robustness and reliability of the action when dealing with commits without associated status checks.

@GrantBirki GrantBirki merged commit efe4892 into github:main Nov 1, 2023
@GrantBirki GrantBirki mentioned this pull request Nov 1, 2023
@capthiron capthiron deleted the fix/null-check-for-commit-status branch November 2, 2023 17:04
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

Successfully merging this pull request may close these issues.

2 participants