{"id":18657827,"url":"https://github.com/lightsofapollo/testing-github","last_synced_at":"2025-10-12T01:49:26.159Z","repository":{"id":15230004,"uuid":"17958705","full_name":"lightsofapollo/testing-github","owner":"lightsofapollo","description":"Bunch of very opinionated and specific to testing github utilities used in automation tests","archived":false,"fork":false,"pushed_at":"2015-03-23T19:32:49.000Z","size":188,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-04-25T15:41:25.630Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ElemeFE/element","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightsofapollo.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-20T21:12:17.000Z","updated_at":"2015-03-23T19:32:49.000Z","dependencies_parsed_at":"2022-08-25T11:00:38.416Z","dependency_job_id":null,"html_url":"https://github.com/lightsofapollo/testing-github","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Ftesting-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Ftesting-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Ftesting-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Ftesting-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightsofapollo","download_url":"https://codeload.github.com/lightsofapollo/testing-github/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239475960,"owners_count":19645041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T07:29:58.366Z","updated_at":"2025-10-12T01:49:21.124Z","avatar_url":"https://github.com/lightsofapollo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"testing-github\n==============\n\nBunch of very opinionated and specific to testing github utilities used in automation tests.\n\nSee the [tests/pullrequest_test.js] for an indepth guide how to use\nthis.\n\n## Usage: (fork)\n\nForking github is usually an asynchronous process this method will fork\nand then wait for the repository to be available.\n\n```js\nvar fork = require('testing-github/fork');\n\nfork(githubApi, 'user', 'repo').then(function(forkRepoApi) {\n  // example: get details about the forked repository\n  return forkRepoApi.show();\n});\n\n```\n\n## Usage: (pullrequest)\n\nThe pull request module heavily abstracts the operations required to\nmake a pull request to a given repository.\n\nCalling the module will do the following:\n\n  - create a fork for the token user if not already available\n  - create a unique branch in the fork\n  - add given files to the branch in the fork\n  - create a pull request from the created branch to the specified\n    branch _in the fork_ (not the base repository)\n\n\n```js\n\nvar testPr = require('testing-github/pullrequest');\n\ntestPr(\n  'GITHUB_TOKEN',\n  {\n    repo: 'testing-github', // base repo\n    user: 'lightsofapollo', //base user\n    branch: 'master', // base branch\n    title: 'title of the pr',\n    body: 'description of the pull request',\n    files: [\n      { commit: 'I haz add file', path: 'filename.txt', content: 'content of file' }\n    ]\n  }\n).then(function(pullRequest) {\n  // XXX: Add documentation for the pull request repsonse\n});\n\n```\n\n## NOTES:\n\nIn the original design pull requests where made directly to the base\nrepository this works fairly well but results in massive amounts of\nemail spam and may require extra permissions... In the current design we\nfork the base repository and then issue pull requests from the fork to\nthe fork.\n\n## TODO:\n\n - redesign api to use a more fluent interface instead of one big\n   options blob (the design is mostly the same from where this code was\n   extracted from right now)\n\n## LICENSE\n\nCopyright 2014, Mozilla Foundation\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightsofapollo%2Ftesting-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightsofapollo%2Ftesting-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightsofapollo%2Ftesting-github/lists"}