Skip to content
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

Get most recent commit id instead of relying on head_commit #78

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

deniak
Copy link
Contributor

@deniak deniak commented Aug 1, 2024

The server logs show that the payload for a push event may not have a head_commit property.

[cgi:error] [pid 3506356:tid 3506356] [client xxx] AH01215: stderr from github-notify-ml/index.py:   File "github-notify-ml/index.py", line 70, in event_id
[cgi:error] [pid 3506356:tid 3506356] [client xxx] AH01215: stderr from github-notify-ml/index.py:     return payload["head_commit"]["id"]
[cgi:error] [pid 3506356:tid 3506356] [client xxx] AH01215: stderr from github-notify-ml/index.py:            ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
[cgi:error] [pid 3506356:tid 3506356] [client xxx] AH01215: stderr from github-notify-ml/index.py: TypeError: 'NoneType' object is not subscriptable

Looking at the documentation, it seems that property can indeed be null.

That PR updates the function to return the most recent commit id instead.

@dontcallmedom dontcallmedom merged commit 446a60a into dontcallmedom:main Aug 19, 2024
1 check passed
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