Skip to content

Commit

Permalink
if commit list is empty, don't pull commit message (temp solution)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbexiga committed Sep 15, 2021
1 parent 3658561 commit 6818ac3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
event_path = os.getenv("GITHUB_EVENT_PATH")
sha = os.getenv("GITHUB_SHA")
actor = os.getenv("GITHUB_ACTOR")
event_payload = json.load(open(event_path))

message = {
"text": f":rocket: Running *{workflow}* on *{repository}/{branch}* :rocket:",
Expand Down Expand Up @@ -55,7 +56,7 @@
},
{
"title": "Commit Message",
"value": '```' + json.load(open(event_path))["commits"][-1]["message"] + '```',
"value": '```' + event_payload["commits"][-1]["message"] + '```' if event_payload.get("commits") else '',
"short": False
}
],
Expand Down

0 comments on commit 6818ac3

Please sign in to comment.