/** * Removes a webhook from a repository. * *@param \App\Models\User\User $user * @param \App\Models\Repository\Repository $repository * * @return bool */ public function remove(User $user, Repository $repository) { $this->delete($user, '/repos/' . $repository->getRouteKey() . '/hooks/' . $repository->hook_id); $repository->update(['hook_id' => null]); return true; }
/** * Gets a download link to a repository's specific tag. * * @param \App\Models\Repository\Repository $repository * @param string $tag * * @return string|null */ public function link(Repository $repository, $tag) { $tag = strlen($tag) === 0 ? env('GIT_BRANCH') : $tag; return 'repos/' . $repository->getRouteKey() . '/zipball/' . $tag; }