From ba51d4ad7d6e2c9046a479f7796e0475f7368767 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 22 Nov 2019 14:26:03 +0000 Subject: [PATCH] BUGFIX: Don't hardcode release attachemnt ID --- src/Repo.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Repo.php b/src/Repo.php index 03dcfb1..dac849d 100644 --- a/src/Repo.php +++ b/src/Repo.php @@ -95,9 +95,9 @@ class Repo{ return new Issue($this,$data); } - public function addAttachment($path,$type='image/png'){ - $url="repos/{$this->user}/{$this->repo}/releases/1/assets?name=test"; - $args=['attachment'=>new \CurlFile($path, $type, 'filename.png')]; + public function addReleaseAttachment($releaseId,$path){ + $url="repos/{$this->user}/{$this->repo}/releases/$releaseId/assets?name=test"; + $args=['attachment'=>new \CurlFile($path)]; $data=$this->client->request($url,'FORM',$args); return $data; }