From 259399bc103f61daee068eefcd1f2d205a1c6816 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Tue, 8 Feb 2022 23:05:27 +0100 Subject: ver 0.1.0 --- rss_to_gitea/main.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'rss_to_gitea/main.py') diff --git a/rss_to_gitea/main.py b/rss_to_gitea/main.py index c1a4a11..8d31197 100644 --- a/rss_to_gitea/main.py +++ b/rss_to_gitea/main.py @@ -16,10 +16,17 @@ USAGE: def main(): if len(sys.argv) <= 1: + print_help() return 1 config = Config(sys.argv[1]) - api = GiteaAPI("https://gitea.my.cum.re", config.token) + + token = config.token + if str.startswith(token, 'env/'): + splt = token.split('/',1) + token = os.environ[splt[1]] + + api = GiteaAPI(config.url, token) label_id = api.getLabelId(config.owner, config.repo, config.label) @@ -35,4 +42,6 @@ def main(): print(f'{issue_title} already exists. Skipping') continue - result = api.createIssue(config.owner, config.repo, issue_title, '', feed['assign'], [label_id]) + print(feed) + + result = api.createIssue(config.owner, config.repo, issue_title, latest['link'], feed['assign'], [label_id]) -- cgit v1.2.3