Skip to content

bug: handle edge cases where the committer object is missing a login attribute #380

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

Merged
merged 2 commits into from
Mar 21, 2025

Conversation

GrantBirki
Copy link
Member

resolves: #379

@GrantBirki GrantBirki added the bug Something isn't working label Mar 21, 2025
@GrantBirki GrantBirki self-assigned this Mar 21, 2025
@Copilot Copilot AI review requested due to automatic review settings March 21, 2025 16:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a bug by handling cases where the committer object does not include a login property during deployments. It updates the core logic in src/main.js to safely access the committer property and adds a dedicated test in tests/main.test.js to validate the behavior when the committer login is missing.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/main.test.js Adds a test case for the scenario where the committer login is missing.
src/main.js Updates the run function to use optional chaining for the committer object and log a warning.
Comments suppressed due to low confidence (2)

src/main.js:469

  • Ensure that all subsequent usage of 'committer' correctly handles an undefined value to avoid potential runtime errors.
const committer = commitData.data?.committer?.login

tests/main.test.js:324

  • [nitpick] For clarity in testing the absence of the login attribute, consider explicitly setting 'committer.login' to undefined rather than an empty object.
committer: {}

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

@cybergoof cybergoof self-requested a review March 21, 2025 16:28
@GrantBirki GrantBirki merged commit 1c8e9e5 into main Mar 21, 2025
4 checks passed
@GrantBirki GrantBirki deleted the committer-fixes branch March 21, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: improved logs when committer object is empty
2 participants