Make paths in the archive relative to the attachment_path directory

This commit is contained in:
Michał Politowski 2023-01-12 16:30:56 +01:00
parent 30e0d2ae39
commit 9bc4b6370b
1 changed files with 1 additions and 1 deletions

View File

@ -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}' }