Download the PHP package devshop/github-api-cli without Composer
On this page you can find all versions of the php package devshop/github-api-cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devshop/github-api-cli
More information about devshop/github-api-cli
Files in devshop/github-api-cli
Package github-api-cli
Short Description Simple console wrapper for GitHub API
License MIT
Homepage https://getdevshop.com
Informations about the package github-api-cli
GitHub API CLI Component
The GitHubApiCli component a simple console wrapper for the GitHub API to allow abstract command line interaction.
Built on knp-labs/github-api.
Usage
Commands
github api
Passes directly to `GitHub\Api\AbstractAPI classes.
Only "show" works right now, but it should successfully return any object.
Load info about an organization:
Show info about a repo:
github deployment:start
Creates a new deployment and saves the ID as a git config item.
bin/github deployment:start --environment=dev --description="Manual deployment triggered as an example."
Then use deployment:update to change the status.
github deployment:update
Updates the status of a deployment.
bin/github deployment:update --state=in_progress --description="Building our thing..." --log_url=$OUR_BUILD_LOGS_URL
You can use bash operators to set different state based on exit code of a script.
Use && after a command to designate a command to run on success.
Use || after a command to designate a command to run on failure.
deploy.sh \
&& bin/github deployment:update --state=success --description="This deployment update will only happen if deploy.sh returns exit code 0" \
|| ( bin/github deployment:update --state=failure --description="This deployment update will only happen if deploy.sh returns exit 1." && exit 1 )
See The DevShop Build tests as an example https://github.com/opendevshop/devshop/blob/09fbf10286994c378fa24cf6b9f91e9df33928dd/.github/workflows/build.yml#L110
If you are using a CI runner, be sure to exit 1 after the failure command, to
ensure the overall script exits with a failure as well.
SSL Issues
If you encounter any SSL errors, such as the one below, you can tell the HTTPClient Library Guzzle to skip SSL verification.
60: SSL certificate problem: self signed certificate in certificate chain
All DevShop components that use the GitHub API can be configured to skip the SSL certificate verification. Set the following environment variable to ignore SSL errors:
export DEVSHOP_GITHUB_API_IGNORE_SSL=1
See YamlTasksConsoleCommand.php and GitHubApiCli.php to see the implementation.
Resources
Credits
$CREDITS
All versions of github-api-cli with dependencies
consolidation/robo Version ^2
knplabs/github-api Version ^3.9||^1.0
devshop/git-traits Version @dev
guzzlehttp/guzzle Version ^6
php-http/guzzle6-adapter Version 2.x-dev