BUGFIX: Don't hardcode release attachemnt ID

This commit is contained in:
James 2019-11-22 14:26:03 +00:00
parent 0ce51d3306
commit ba51d4ad7d

View File

@ -95,9 +95,9 @@ class Repo{
return new Issue($this,$data); return new Issue($this,$data);
} }
public function addAttachment($path,$type='image/png'){ public function addReleaseAttachment($releaseId,$path){
$url="repos/{$this->user}/{$this->repo}/releases/1/assets?name=test"; $url="repos/{$this->user}/{$this->repo}/releases/$releaseId/assets?name=test";
$args=['attachment'=>new \CurlFile($path, $type, 'filename.png')]; $args=['attachment'=>new \CurlFile($path)];
$data=$this->client->request($url,'FORM',$args); $data=$this->client->request($url,'FORM',$args);
return $data; return $data;
} }