Skip to content

Commit

Permalink
Merge pull request #24 from leonhartX/support-private-repo
Browse files Browse the repository at this point in the history
support create private repo from gas
  • Loading branch information
leonhartX authored Jun 21, 2017
2 parents 785b745 + 7accbb3 commit 9e662a3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"
warn("Big PR, try to keep changes smaller if you can") if git.lines_of_code > 500
warn("manifest is not changed, forget to bump version?") if !git.modified_files.include?("manifest.json")

github.dismiss_out_of_range_messages
eslint.filtering = true
eslint.lint
lgtm.check_lgtm
lgtm.check_lgtm
7 changes: 7 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ dependencies:
test:
override:
- danger

deployment:
production:
branch: master
commands:
- zip -r gas-github.zip . -x 'node_modules/*' -x '\.*' -x 'circle.yml' -x 'Dangerfile' -x 'Gemfile*'
- mv gas-github.zip $CIRCLE_ARTIFACTS
9 changes: 9 additions & 0 deletions content/modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@
<td><div>Description</div></td>
<td><input id="new-repo-desc" class="editable-row-input large-input" type="text"></td>
</tr>
<tr class="properties-data-dialog-table-row">
<td><div>Type</div></td>
<td><div style="white-space: normal;">
<select id="new-repo-type">
<option value="public">Public</option>
<option value="secret">Private</option>
</select>
</div></td>
</tr>
</tbody>
</table>
</div>
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.0",
"version": "2.0.1",
"manifest_version": 2,
"default_locale": "en",
"name": "__MSG_appName__",
Expand Down
5 changes: 4 additions & 1 deletion src/github-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,12 @@ function getGithubRepos() {
function githubCreateRepo() {
const repo = $('#new-repo-name').val();
const desc = $('#new-repo-desc').val();
const isPrivate = $('#new-repo-type').val() !== 'public';
const payload = {
name : repo,
description : desc,
auto_init : true
auto_init : true,
private: isPrivate
}
if (!repo || repo === "") return;
new Promise((resolve, reject) => {
Expand Down Expand Up @@ -322,6 +324,7 @@ function githubCreateRepo() {
.then(() => {
$('#new-repo-name').val("");
$('#new-repo-desc').val("");
$('#new-repo-type').val("public");
showAlert(`Successfully create new repository ${repo}`);
})
.catch((err) => {
Expand Down

0 comments on commit 9e662a3

Please sign in to comment.