GitHub API¶
The GitHub API provides a set of endpoints for interacting with GitHub repositories, issues, pull requests, and more. It allows users to programmatically manage their GitHub accounts and projects.
Why Integrate GitHub with EasyTask?¶
Integrating GitHub with EasyTask enables you to automate repository management and development workflows. This integration allows you to:
- Automate Repository Lifecycle: Create, clone, and delete repositories programmatically as part of your EasyTask workflows without manual intervention.
- Streamline Issue Management: Create and close GitHub issues automatically, keeping your project tracking in sync with your automated workflows.
- Manage Code and Files: Create, update, upload, and delete files in your repositories through EasyTask orchestration, enabling automated deployment and content management pipelines.
Required Values in Vault¶
{
"is_credentials": {
"userid": "test",
"passwd": "test123"
},
"integrations": {
"integration": "github",
"uuid": "ae0e8ba9-423a-410e-bba5-e1933ff868c5",
"init": {
"vault_path_key": "github/server1"
}
}
}
Example Usage¶
curl -X POST http://localhost:8008/run-integration \
-H "Content-Type: application/json" \
-d '{
"is_credentials": {
"userid": "test",
"passwd": "test123"
},
"integration": "github",
"uuid": "ae0e8ba9-423a-410e-bba5-e1933ff868c5",
"init": {
"vault_path_key": "github/secret"
},
"action": [
{
"see_user": {}
}
]
}'
Functions¶
see_user¶
see_user: This function retrieves information about the authenticated user.
see_repos¶
see_repos: This function lists all repositories for the authenticated user.
clone_repo¶
clone_repo: This function clones one or more repositories.
create_repo¶
create_repo: This function creates a new repository.
delete_repo¶
delete_repo: This function deletes one or more repositories.
count_of_stars¶
count_of_stars: This function retrieves the number of stars for a repository.
get_labels¶
get_labels: This function retrieves the labels for a repository.
create_file¶
create_file: This function creates a new file in a repository.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| repo_name | str | Name of the repository | yes |
| file_name | str | Name of the file to create | yes |
| content | str | Content of the file | yes |
| message | str | Commit message | yes |
| branch | str | Branch to create the file in | yes |
| Output Parameter | Type | Description |
|---|---|---|
| response | dict | Information about the created file |
upload_files¶
upload_files: This function uploads multiple files to a repository.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| repo_name | str | Name of the repository | yes |
| file_names | list | List of file names to upload | yes |
| message | str | Commit message | yes |
| branch | str | Branch to upload the files to | yes |
| Output Parameter | Type | Description |
|---|---|---|
| response | dict | Status of upload operation for each file |
update_file¶
update_file: This function updates an existing file in a repository.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| repo_name | str | Name of the repository | yes |
| file_name | str | Name of the file to update | yes |
| new_content | str | New content of the file | yes |
| message | str | Commit message | yes |
| branch | str | Branch containing the file | yes |
| Output Parameter | Type | Description |
|---|---|---|
| response | dict | Information about the updated file |
update_local_files¶
update_local_files: This function updates local files and pushes changes to a repository.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| repo_name | str | Name of the repository | yes |
| file_names | list | List of file names to update | yes |
| message | str | Commit message | yes |
| branch | str | Branch to update | yes |
| Output Parameter | Type | Description |
|---|---|---|
| response | dict | Status of update operation for each file |
delete_files¶
delete_files: This function deletes files from a repository.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| repo_name | str | Name of the repository | yes |
| file_names | list | List of file names to delete | yes |
| message | str | Commit message | yes |
| branch | str | Branch containing the files | yes |
| Output Parameter | Type | Description |
|---|---|---|
| response | dict | Status of deletion operation for each file |
createissue¶
createissue: This function creates a new issue in a repository.
closeissue¶
closeissue: This function closes an issue in a repository.
open_issues¶
open_issues: This function retrieves open issues for a repository.
list_branches¶
list_branches: This function lists all branches in a repository.
create_branch¶
create_branch: This function creates a new branch in a repository.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| repo_name | str | Name of the repository | yes |
| source_branch | str | Name of the source branch | yes |
| target_branch | str | Name of the new branch to create | yes |
| Output Parameter | Type | Description |
|---|---|---|
| response | dict | Information about the created branch |
checkout_branch¶
checkout_branch: This function checks out a branch in a repository.
create_pullrequest¶
create_pullrequest: This function creates a new pull request in a repository.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| repo_name | str | Name of the repository | yes |
| source_branch | str | Name of the source branch | yes |
| target_branch | str | Name of the target branch | yes |
| title | str | Title of the pull request | yes |
| body | str | Description of the pull request | yes |
| Output Parameter | Type | Description |
|---|---|---|
| response | dict | Information about the created pull request |
list_pullrequests¶
list_pullrequests: This function lists all pull requests in a repository.
merge_pullrequest¶
merge_pullrequest: This function merges a pull request in a repository.
acces_logs¶
acces_logs: This function retrieves access logs for a repository.
Frequently Asked Questions¶
How do I configure GitHub credentials in EasyTask?¶
Use the EasyTask vault system to securely store your GitHub connection credentials. Navigate to the integration configuration page and add your server details under a vault key like github/server1.
Can I use GitHub with both EasyTask Cloud and On-Premises?¶
Yes, GitHub works seamlessly with both EasyTask Cloud and On-Premises deployments. The configuration process is identical since GitHub is a cloud-based service.
How do I troubleshoot GitHub connection issues?¶
Check the integration server logs in EasyTask for detailed error messages. Verify your credentials in the vault, ensure the GitHub API is accessible from the integration server, and test connectivity using the built-in connection test feature.