diff --git a/scripts/validate_commit.py b/scripts/validate_commit.py index 8804dce..564f806 100644 --- a/scripts/validate_commit.py +++ b/scripts/validate_commit.py @@ -12,7 +12,8 @@ if is_pull_request: os.system('git fetch --deepen=1 --no-tags --quiet') - command_args = ['git', 'log', '--format=%B', '-n', '1', github['event']['after']] + sha = github['event'].get('after', github['event']['pull_request']['sha']) + command_args = ['git', 'log', '--format=%B', '-n', '1', sha] else: command_args = ['git', 'show', '-s', '--format=%s']