Merge pull request 'Make paths in the archive relative to the attachment_path directory' (#2) from michal.politowski/Gitea-auto-release:relative_paths_in_archive into master

Reviewed-on: #2
This commit is contained in:
Sandro La Bruzzo 2023-01-17 16:35:25 +01:00
commit 3b46f0bc62
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}' }