forked from D-Net/Gitea-auto-release
Make paths in the archive relative to the attachment_path directory
This commit is contained in:
parent
30e0d2ae39
commit
9bc4b6370b
|
@ -61,7 +61,7 @@ class GiteaRepoBridge:
|
||||||
|
|
||||||
def create_attachment(self, attachment_path:str, attachment_name:str, release_id:str, release_name:str):
|
def create_attachment(self, attachment_path:str, attachment_name:str, release_id:str, release_name:str):
|
||||||
http = urllib3.PoolManager()
|
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:
|
with open("/tmp/attachment.tar.gz", 'rb') as f:
|
||||||
file_data = f.read()
|
file_data = f.read()
|
||||||
header = { 'Authorization': f'token {self.token}' }
|
header = { 'Authorization': f'token {self.token}' }
|
||||||
|
|
Loading…
Reference in New Issue