Beispiel #1
0
 /**
  * Send the pull request to the Laravel repository.
  *
  * @param  string  $username
  * @param  string  $liferaftFile
  * @return string
  */
 protected function sendPullRequest($username, $branch, $toBranch, $liferaftFile)
 {
     try {
         return $this->github->sendPullRequest($username, $branch, $toBranch, $this->getLiferaftFile());
     } catch (\Exception $e) {
         $this->failed();
         $this->kill('Unable to send pull request. Do you already have one open?');
     }
 }
Beispiel #2
0
 /**
  * Execute the action.
  *
  * @return void
  */
 public function execute()
 {
     $this->task('Deleting Liferaft Repository...', function () {
         try {
             $this->github->deleteRepository($this->github->getUsername(), 'liferaft');
         } catch (\Exception $e) {
             $this->failAndKill('Unable to delete repository. Does your GitHub token have enough permissions?');
         }
         @unlink(getcwd() . '/liferaft.md');
     });
     $this->info('Done! This directory may be deleted.');
 }
Beispiel #3
0
 /**
  * Rename the given repository.
  *
  * @param  string  $username
  * @param  string  $repository
  * @param  string  $name
  * @return void
  */
 protected function renameRepository($username, $repository, $name)
 {
     try {
         $this->github->rename($username, $repository, $name);
     } catch (\Exception $e) {
         sleep(3);
         $this->renameRepository($username, $repository, $name);
     }
 }
Beispiel #4
0
 /**
  * Get the pull request at the given ID.
  *
  * @return array
  */
 protected function getPullRequest($id)
 {
     if ($id == 'random') {
         $id = $this->github->getRandomPullRequestId();
     }
     try {
         return $this->github->getPullRequest($id);
     } catch (\Exception $e) {
         $this->failAndKill('Invalid pull request ID.');
     }
 }