jruedaq / php-github-issues-report
Create a Github issue in a repository from PHP project
v1.0.1
2021-03-17 23:03 UTC
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^9.5
README
PHP Github Issues Report
First steeps
Installation
composer require jruedaq/PHP-Github-issues-report
Basic use
Create Github personal access token
In Developer settings need create a personal access token and set repo permission
For private repositories use, set all repo permission
If need use only public repositories, set public_repo permission
Use library
In your php file call autoload.php
require 'vendor/autoload.php';
Call the function and pass the respective parameters
$issueNumber = PHPGithubIssuesReport::send($owner, $repo, $token, $title, $body);
Complete example
<?php use jruedaq\GithubIssuesReport\PHPGithubIssuesReport; require_once '../vendor/autoload.php'; $owner = 'Oneago'; // User or company username $repo = 'CanvasVoteSystem'; // Repository name $token = '870082df3998d104ba4164cb07217d5a734bb8fd'; // Personal access token, get from {@link https://github.com/settings/tokens} with [repo] permission $title = 'Testing a issue reporting from PHP'; // Title for new issue $body = 'This is a description text bellow title in github issues'; // Body description for new issue try { $issueNumber = PHPGithubIssuesReport::send($owner, $repo, $token, $title, $body); echo "Created issue #$issueNumber"; // Display issue number } catch (Exception $e) { echo $e->getMessage(); }