Skip to content

Commit

Permalink
ci: fix changelogger for non-semantic commits
Browse files Browse the repository at this point in the history
Should the changelogger find a non sematic commit, it previously crashed and could only run should the commit be reworded, resulting in a rebase of develop. Instead the changelogger has been changed to work with non semantic commits, giving a warning should one appear.
  • Loading branch information
phbelitz committed Feb 8, 2022
1 parent 4ab7918 commit 6845fe7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/changelogger.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import re
import requests
import json
import subprocess
import time
import argparse
import base64
import logging

sep = "@@__CHGLOG__@@"
delim = "@@__CHGLOG_DELIMITER__@@"
Expand All @@ -28,8 +27,13 @@ class Commit:
def __init__(self, hash_: str, sub_cat_: str, token: str = None):
self.hash_ = hash_.strip()
cat_sub_split = sub_cat_.split(":", 1)
self.subject_ = cat_sub_split[1].strip()
self.categories_ = cat_sub_split[0].split("/")
try:
self.subject_ = ":".join(cat_sub_split[1:]).strip()
self.categories_ = cat_sub_split[0].split("/")
except IndexError:
logging.warn("Non semantic commit")
self.subject_ = cat_sub_split[0]
self.categories_ = ["none"]
self.token = token
self.pr_ = self.get_pr_link()

Expand Down

0 comments on commit 6845fe7

Please sign in to comment.