2017 © Pedro Peláez
 

robo-tasks robo-github

GitHub for Robo Task Runner

image

droath/robo-github

GitHub for Robo Task Runner

  • Saturday, November 11, 2017
  • by droath
  • Repository
  • 0 Watchers
  • 1 Stars
  • 4,844 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 8 % Grown

The README.md

Robo GitHub

Run GitHub commands from the Robo task runner., (*1)

Getting Started

First, you'll need to download the Robo GibHub library using composer:, (*2)

composer require droath/robo-github

Next, you'll need to create a personal access token on GitHub so you have access to your private repositories via a Robo task. Follow this GitHub guide to obtain your access token., (*3)

Once you've created your GitHub token you'll need to pass the access token along with the GitHub project user or organization and repository name, like the following:, (*4)

<?php
    $token = 'OJuJcqaYiX5uL72Ky';
    $account = 'droath';
    $repository = 'robo-github';

    $response = $this
        ->taskGitHubIssueAssignees($token, $account, $repository)
        ...
        ...
        ->run();

    var_dump($response);

The GitHub account and repository arguments can also be defined using the set methods:, (*5)

<?php
    $response = $this
        ->taskGitHubIssueAssignees('OJuJcqaYiX5uL72Ky')
        ->setAccount('droath')
        ->setRepository('robo-github')
        ...
        ->run();

    var_dump($response);

Example

Retrieve GitHub issues:, (*6)

<?php
    $issues = $this->taskGitHubIssueList('OJuJcqaYiX5uL72Ky')
        ->setAccount('droath')
        ->setRepository('robo-github')
        ->filter('assigned')
        ->state('opened')
        ->labels(['bug', 'duplicates'])
        ...
        ->run();

    var_dump($issues);

Assign a GitHub issue:, (*7)

<?php
    // The GitHub issue number.
    $number = 6;

    // The GitHub user name to assign the issue too.
    $assignee = 'droath';

   $response = $this->taskGitHubIssueAssignees('OJuJcqaYiX5uL72Ky')
        ->setAccount('droath')
        ->setRepository('robo-github')
        ->number($number)
        ->addAssignee($assignee)
        ->run();

Create repository statuses:, (*8)

<?php

    // GitHub commit sha reference.
    $sha = 'c70cc19bc1bc817971ad693e58a15ed5703b439d';

    // GitHub status state.
    $state = 'success';

    $this->taskGitHubIssueAssignees('OJuJcqaYiX5uL72Ky')
        ->setAccount('droath')
        ->setRepository('robo-github')
        ->setSha($sha)
        ->setParamState($state)
        ->setParamDescription('State description!')
        ->setParamContext('vendor/projctname')
        ->run();

Support

I'll be adding more GitHub commands as they're needed. Feel free to create a PR or an issue with any problems you're having., (*9)

The Versions

11/11 2017

dev-master

9999999-dev

GitHub for Robo Task Runner

  Sources   Download

MIT

The Requires

 

The Development Requires

git github robo hub task runner

11/11 2017

0.0.2

0.0.2.0

GitHub for Robo Task Runner

  Sources   Download

MIT

The Requires

 

The Development Requires

git github robo hub task runner

02/04 2017

0.0.1

0.0.1.0

GitHub for Robo Task Runner

  Sources   Download

MIT

The Requires

 

The Development Requires

git github robo hub task runner