1
0
mirror of https://github.com/MaxenceG2M/github-release-notifier.git synced 2025-12-08 13:53:24 +00:00

Validate configuration + readable error

Change docker-compose version - use Just to handle version
This commit is contained in:
2023-11-25 01:50:27 +01:00
parent 07dccee235
commit 8dba474e23
2 changed files with 9 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ version: '3'
services:
notifier:
build: .
image: github-release-notifier:1
image: github-release-notifier
container_name: github-release-notifier
volumes:
- ./conf.ini:/app/conf.ini

View File

@@ -3,6 +3,7 @@ import datetime
import json
import os
import smtplib
import sys
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
@@ -36,7 +37,13 @@ def main():
parser.read(conf_file)
default_config = parser["config"]
projects = json.loads(parser.get("projects", "projects"))
try:
projects = json.loads(parser.get("projects", "projects"))
except json.decoder.JSONDecodeError as jse:
print("ERROR: config file is not correctly JSON formatted!", end="\n\t")
print(jse)
sys.exit(1)
new_releases = []
new_projects = []