From 9bc4b6370b4c105792a6d26fd02b9e26a52619e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Politowski?= Date: Thu, 12 Jan 2023 16:30:56 +0100 Subject: [PATCH] Make paths in the archive relative to the attachment_path directory --- gitea_release.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitea_release.py b/gitea_release.py index e961ac8..40eda05 100644 --- a/gitea_release.py +++ b/gitea_release.py @@ -61,7 +61,7 @@ class GiteaRepoBridge: def create_attachment(self, attachment_path:str, attachment_name:str, release_id:str, release_name:str): http = urllib3.PoolManager() - os.system(f"tar -czf /tmp/attachment.tar.gz -P {attachment_path}") + os.system(f"tar -C {attachment_path} -czf /tmp/attachment.tar.gz .") with open("/tmp/attachment.tar.gz", 'rb') as f: file_data = f.read() header = { 'Authorization': f'token {self.token}' }